Reputation: 4167
Till now, I have been using google charts and UIWebView to show graphs in my iPhone application.
I would like to start using CorePlot so that I do not need to be dependent on the internet connection to show my graphs. However, I am lost on how to use CorePlot for my applications.
Would someone be able to help me out with how I should use CorePlot?
Upvotes: 0
Views: 2735
Reputation: 1893
The official Core Plot documentation is out of date (on the wiki, on the google code site, AND the read me information downloaded with the project from github...).
Here are some current steps to follow to add the static Core Plot library to your project:
1) download the latest version of CorePlot here
2) navigate to the CorePlot framework folder and run CorePlot-CocoaTouch.xcodeproj
3) build (not run) the CorePlot-CocoaTouch.xcodeproj project
4) navigate back to your CorePlot download folder > build > Debug-iphoneos and verify libCorePlot-CocoaTouch.a has been created. If not, unzip the download and repeat steps 1-4
5) back in Xcode highlight the CorePlot-CocoaTouch project
6) click Product > Scheme > select Universal Library (selects which target to build)
7) build project again (not run)
8) go BACK to your CorePlot download folder > build > Release-universal and you will see the CorePlotHeaders folder and libCorePlot-CocoaTouch.a are both available
9) open the Xcode project you would like to add static CorePlot to
10) add the CorePlot > build > Release-universal > CorePlotHeaders folder and libCorePlot-CocoaTouch.a files to your project (selecting 'copy items into destination group's folder)
11) select your Project and in the 'Linking' section find 'Other Linker Flags' and add '-ObjC'
12) from your Target > Build Phases > Link Binary With Libraries add the QuartzCore framework to your project
13) if libCorePlot-CocoaTouch.a is not in your Link Binary With Libraries list drag it from where you copied it to your project to the Library list to add it.
You should now be able to #import "CorePlot-CocoaTouch.h" (autocomplete) to the viewcontroller that you will be using to manage your CorePlot.
If you are following old documentation on how to use CorePlot be aware that the new prefix is CPT (not CP, adjust accordingly)
Happy coding!
Upvotes: 1
Reputation: 27381
Look through the example apps included with Core Plot. The Plot Gallery app (available for MacOS, iPhone, and iPad) shows examples of all of the supported plot types and demonstrates many Core Plot features.
Upvotes: 1
Reputation: 5365
Check this tutorial featured by google code's site: http://www.switchonthecode.com/tutorials/using-core-plot-in-an-iphone-application
And this instructions are worth reading too: http://code.google.com/p/core-plot/wiki/UsingCorePlotInApplications
Hope it helps!
Upvotes: 1