Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Line Graphing?

What would be the easiest way to graph a line graph on a iOS app? I am building a iOS app that needs a line graph I don't need anything complex just something that will graph a int.

I have seen core graph but not sure if thats the way to go.

like image 223
user964627 Avatar asked Nov 07 '11 22:11

user964627


People also ask

How do you make a line graph on iPhone word?

Create ChartTap the "+" symbol that appears in the toolbar near the top of the screen and then select "Charts" from the list of options that appears on your screen. You'll then see a list of available charts, including line charts, pie charts and others.


2 Answers

You're probably thinking of core-plot, which would be a fine solution if you want something that has a lot of features and is ready out of the box.

If you want something more minimal, you could create your own line graph UIView subclass very easily and make it do exactly what you want. Building a general-purpose graph library is a lot of work because there are so many ways that people like to vary their graphs. If you know exactly what you want and don't need something more flexible, rolling your own can be a quick and effective solution.

If you do decide to roll your own, Matt Gallagher's Cocoa With Love blog has a number of very good graphics entries to get you started.

like image 183
Caleb Avatar answered Oct 07 '22 11:10

Caleb


Apple's Accelerometer sample app (on their iOS Developer Center web site) includes some example code for a simple line graph.

like image 40
hotpaw2 Avatar answered Oct 07 '22 12:10

hotpaw2