One of the simpler and nicer available graph controllers your iPhone app is from the Tapku library. The tapku library is created by the team at http://tapku.com/ at hosted at http://github.com/devinross/tapkulibrary.
The graph view controller I find as a good mix between a simple SparkLine (http://key-solutions.ca/cksparkline.html) and the full-on core-plot.
Implementing the whole Tapku library is overkill to just use the chart and in fact can be a little difficult for beginners too.
To implement the graph follow the following steps:

1.Copy the following files out of the Tapku Library and copy into your project:
GraphController.h & GraphController.m
TKGraphController.h & TKGraphController.m
TKGraphView.h & TKGraphView.m
TKGlobal.h & TKGlobal.m
UIImageAdditions.h & UIImageAdditions.m
UIViewAdditions.h & UIImageAdditions.m
TapkuLibrary.bundle (for the graphics)
2. Add the framework QuartzCore
#import <QuartzCore/QuartzCore.h>
3. In GraphController.h, remove the line to import the full Tapku Library and import TKGraphController.h and TKGraphView.h.
Alter GraphController.h to:
//#import <TapkuLibrary/TapkuLibrary.h>
#import “TKGraphController.h”
#import “TKGraphView.h”
4. Now to call the graph, we display it as a modal view controller. Use the following code in your project to push the view onto the screen:
In your header file add:
#import “GraphController.h”
In the main add
UIViewController *vc = [[GraphController alloc] init];
[vc setModalTransitionStyle:UIModalTransitionStyleCrossDissolve];
[self presentModalViewController:vc animated:YES];
[vc release];
return;
And thats it!
I have a sample xcode project available too.
![]() |
 |


