views:

13522

answers:

9

I have a need to render and display charts (bar charts for now, but more types may be needed later) in an iPhone app I'm working on. I've done some looking around and it doesn't look like there are any really good, mature charting libraries for iPhone yet. I've also looked for something written for Cocoa on the Mac that can be adapted, but haven't found anything great yet.

Anybody dealt with this before? Any recommendations?

I did find Core Plot, but it seems to be in the early stages of development.

Edit to add some details of requirements (as they currently stand ;) )

  • Bar Charts
  • Horizontal bar charts
  • Double stacked bar charts
  • Axis labels (including rotated 90 degrees on the y axis)
  • Labels above each bar on the chart
  • Shaded or custom backgrounds
+18  A: 

One of the many factors that motivated the Core Plot project was the lack of good plotting frameworks on the iPhone. Core Plot also encompases many other use cases including desktop systems, but its design has included iPhone support from the beginning. It's getting pretty close to useable and is currently in use in several shipping iPhone and OS X applications.

Edit 2/10

Core Plot has come a long way since I first posted the summary. The framework now has bar charts (including horizontal bar charts, I believe), axis labels (including aribrarty rotations), and fills and backgrounds for graphs. I'm not sure about stacked bar charts, but it wouldn't be hard to add to the CPBarPlot class that implements bar charts. As for annotations, there is a CPAnotation class which you could subclass to add your annotations, if there isn't the exact functionality you need.

Project on google code.

Barry Wark
Agreed. There are some very good scientifically-minded Cocoa programmers working on this, so I'd expect it to advance rapidly. Also, the Google Group for this is at http://groups.google.com/group/coreplot-discuss?hl=en . The archives are worth reading through, to see where people are going with this.
Brad Larson
I've looked into Core Plot and it looks like bar charts are completely unimplemented. Still I'll keep an eye on this project.
Mike Akers
In the interim, many features have been added to Core Plot, including bar charts, horizontal bar charts, custom plot labels, angled labels, and themes (including custom backgrounds).
Brad Larson
Core Plot has definitely come a long way since the last time I looked at it. I'm using it in a new project I'm working on now, and it is possible to do a stacked bar chart by rendering multiple bar charts on top of eachother and adding the height of the frontmost values to the rear values (hope that made some sense, search the Core Plot google group for more details)
Mike Akers
+3  A: 

I went through my own search a year or two ago, and ended up making my own line graphing classes because I couldn't find anything that worked exactly the way I needed it to. The two big ones to look at though, are SM2DGraphView and GraphX. I haven't tried either in an iPhone project, but I know SM2DGraphView is open source so you could modify it if needed.

I've also considered using a WebView to use a JavaScript graphing library, but that's just a thought.

Marc Charbonneau
+1  A: 

You can theoretically use the Google Chart API along with a Cocoa wrapper. This could be a light-weight solution.

Julien Chastang
I did consider this, but Google Charts won't work without an internet connection.
Mike Akers
+1  A: 

You can check out this place and sign up for the beta .... http://mfxstudios.com/Application.html hopefully its what you're looking

Prince
A: 

"IPhone chart" comes up on Skynet (Google) searches. Haven't tried it. Doesn't look very complete yet - they have serious licence fees but not even a developer guide online yet. Nevertheless there's a trial available, maybe it's an option.

http://www.keepedge.com/products/iphone_charting/

Fletch
A: 

This one seems ok as well

http://code.google.com/p/s7graphview/

(but never tried it really).

yonel
I've used this one, and it'll work, but for very basic data sets. Some of the issues I ran into though was it's inability to plot values below zero, and it had a tendency to round any non-integer values.
joshbuhler
A: 

This is also new chart library for iPhone:

http://www.ivisualization.com/

Dexter
Other than a homepage making promises, does this library actually exist? That link doesn't provide any way to download the library.
joshbuhler
A: 

You can visit this site for charting library....good one http://www.stabilix.com/ichart.html

Johan
How do you know it's a good one? The link is just a place holder for a future product. I'm looking for a solution, not advertising. -1.
cagreen
A: 

there is new, nice Pie Chart 3D library. 3D charts which you can rotate and scale with fingers + protocol for getting information about tapped slice

http://iphone.orpi.pl/?p=20

plusz