How to get point on the graph in iPhone Line graph
HI all,
I'm working on line graph. I'm able to draw line graph perfectly. But the thing is I want the effect like shown in the below image. 开发者_StackOverflow社区
I want the slider effect. I'm storing the graph path using CGPath. If the slider moves on the graph according value has to display on the upper label..
Please help me.
You can't access the data from the CGPath. You need to hold your own data structure (an array or NSArray) with the (x,y) pairs. Then, figuring out what data point corresponds to a location on the screen is a matter of computing the inverse of the function you used to figure out the location on the screen of a data point.
精彩评论