0

I m new in iphone..I create Application in which I maintain data About Income ,Expenses, & total balance .I need to display that information in Graph..

Question:- How I display graph in my Iphone application???like suppose If total balance is 1000 and income is 500 then In graph It displays overall graph contains total balacne means 100% and income will Be display as its 20%


Now I get the graph in my application BY using CorePlot But I provide static data ON Axis..I want to display Data from Database.. How can I do that??

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
Hardik rami
  • 359
  • 4
  • 15

4 Answers4

5

Instead of using core plot or an google api that needs an internet connection you can draw a graph yourself using quartz 2d. That's what I did for my app. CorePlot was kind of tricky to install and it seems complicated for small projects.

http://buildmobile.com/creating-a-graph-with-quartz-2d-part-3/

The advantage of drawing the graphs yourself is that you learn to use the standard drawing apis from Apple. Good luck

Ayrad
  • 3,996
  • 8
  • 45
  • 86
  • 1
    I just recently implemented my own graphing library that I feel is pretty easy to use. Check it out. https://github.com/jsetting32/JSGraphKit – jsetting32 Mar 08 '15 at 00:54
3

The easiest way is to use google chart api, I use this in all my apps.

see the tutorial here,

http://code.google.com/apis/chart/image/docs/making_charts.html

you will directly get image as per your requirement just by making one HTTP Request.

HarshIT
  • 4,583
  • 2
  • 30
  • 60
  • Hadley:- I check it..But I have to Make graph..so can u suggest me for that I dnt need to use Chart Using Get & Post method.. – Hardik rami Feb 17 '12 at 06:35
  • ok Rami , which graph do you want to draw ? , simple line graph ? or any else ? – HarshIT Feb 17 '12 at 06:58
  • simple line graph...I m just create it first time so i want to clear concept about graph in iphone – Hardik rami Feb 17 '12 at 07:23
  • then you should go to http://core-plot.googlecode.com/hg/documentation/html/iOS/index.html – HarshIT Feb 17 '12 at 07:30
  • Which framework and classes I Have to copy or add in my application to display the graph?? – Hardik rami Feb 17 '12 at 07:32
  • 2
    Why don't you try downloading core-plot, reading the documentation they provide, trying the examples and using search functions (google is your friend). You are going to have to do some of this.... – Nick Bull Feb 17 '12 at 10:02
2

If you want to draw graphs in iPhone applications using Objective-C or Swift, you can use SciChart, which supports over 20 popular chart types, including Column and Bar.

There are some really nice examples over at the scichart website for drawing chart types in Objective-C and Swift.

For instance:

Examples are also hosted on Github and there are also tutorials to help you learn this powerful tool.

enter image description here.

As a disclosure, i am the tech lead on the scichart project

Dr. Andrew Burnett-Thompson
  • 20,980
  • 8
  • 88
  • 178
2

I used Core Plot, it's easy to use and there are samples for almost all the graphs...

Costique
  • 23,712
  • 4
  • 76
  • 79
Imran
  • 2,985
  • 19
  • 33
  • I already know that but How i Start to learn that.. I m confused..can u guide me What I do First from that link?? – Hardik rami Feb 17 '12 at 06:37
  • Core plot is good for small datasets, but it's really slow. There's a performance comparison here which compares against iOS-Charts, Coreplot, and two commercial charts for larger datasets, or frequent update: https://www.scichart.com/ios-chart-performance-comparison – Dr. Andrew Burnett-Thompson Jul 18 '17 at 20:20