tags:

views:

122

answers:

2

I have drawn an line graph (as an unclosed path) with 10 (x,y) points by using CGContextBeginPath, CGContextAddLineToPoint and CGContextMoveToPoint . I would like to be able to retrieve the vertical coordinate (y) of the path where the user have given input of the horizontal coordinate (x) by touching the screen, so I can display further information about the graph. Any ideas on what is the best way to achieve this?

thanks

+1  A: 

y = mx + b

Jason Coco
A: 

Use CGPathGetCurrentPoint(CGPath *) method. Hope this helps.

PARTH