i wanna to make a bar/line graph showing progress of the body weight wrto day,week,month and year,all in a segmentd control. the body weight are shown as increment of 20 in X axis(20,40,60 etc.) and the y value should be 1,2,3 etc irrespective of the segmented control values. If the segmened control value is chosen as day, the y value will read as 1 day, 2 day etc. and if it is week,the y value would be 1 week, 2 week and so on.
for eg: if the weigh开发者_如何学运维t for the 1 day is 20, 2nd day is 30 and for 3rd day is 25, then the graph sould be as follows..(line graph also accepted)
Any help will be highly appreciated.
Check CorePlot library it's quite decent and simple to use.
CorePlot plot examples
Other way is draw the bar manually, using CoreGraphics. Then you are just drawing CGRects with a proper height. It's more customizable but more coding too.
Check this : http://iphoneapplicationdevelopers.blogspot.com/2011/03/iphone-sdk-how-to-draw-bar-charts-using.html
even U can find barchart sample program in core-plot folder ->examples ->CpTestApp .
The best way to generate a bar graph i think is..
http://www.field-theory.org/articles/powerplot/example.html
or for all types of graph see..
http://www.keepedge.com/products/iphone_charting/
精彩评论