views:

4293

answers:

6

Hello All,

Looking at adding some data graphing to a new iPhone app in development (ala the Stocks app).

I realize I could buckle down and do some Quartz drawing but I'm hoping that someone somewhere has a tip on a Cocoa graphing framework that works on iPhoneOS.

Any suggestions? It would be a shame to re-invent the wheel if it's out there.

+2  A: 

My understanding is that you won't be able to use any of the existing frameworks as is, due to the restriction on dynamically loaded code (ie frameworkd) on the iPhone. That said, there are several graphing frameworks that are open source and you may be able to crib some of their code.

There're good summaries of two of the most likely candidates, GraphX and SM2DGraphView, on macresarch.org

Barry Wark
+4  A: 

If all you need to do is draw line graphs, take a look at the Seismic example that Apple posted - you can yank large quantities of code from that.

wisequark
I think this example just loads an image for the line graph.
SplittingField
+16  A: 

There's a plotting framework in active development over on Google Code called "CorePlot": http://code.google.com/p/core-plot

It works on both Mac and iPhone.

Dave DeLong
A: 

I was wondering the same thing and came across this sample code (AccelerometerGraph).

link to Apple Dev site.

I have begun to play with core-plot as well. It is quite nice.

SplittingField
+3  A: 

Sweet and simple to use. Straighforward iPhone way: http://code.google.com/p/s7graphview/

Aleks N.
+3  A: 

Despite eisernWolf spamming links to his Google Code page, it is actually pretty OK.

Core Plot is by far the more advanced library, and the way you want to go for math type applications.

But if your goal is some simple data visualisation, s7graphview has the following going for it:

  • Much simpler than core plot.
  • Distributed as source code. Just drop the files into your project.
  • It's a good way to learn how some of the Core Animation stuff works.

Also I think the default style is a little nicer than Core Plot.

Megasaur