简体   繁体   中英

line/bar graph with respect to day,week,month and year iPhone

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 weight 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) BodyWeight与日期的条形图

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/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM