I made a line graph (with a data-line indicator and plotsymbols) using core plot. When I tap on a certain plot symbol the data indicator move to this selected plot symbol. However if two or more symbol are very close to each other then there is a chance hitting the wrong plot symbol. Thus, I decided to let the line indicator be dragged or swipe along, if the user holds a finger and move left/right along the graph. I’m not sure whether I am on the right path using the delegate methode of PlotSpace:
-(BOOL) plotSpace:(CPTPlotSpace *) space shouldHandlePointingDeviceDraggedEvent:(id)event atPoint:(CGPoint)point
I would very much appreciate if somebody has solution or hint to this issue. Thank you in advance!
(Sorry, I wanted to post my graph but seems I’m not allowed to do that yet: )
You’ll also want to implement the down, up, and cancelled event methods to start and stop tracking of the indicator line. The DropPlot example app has an implementation of these methods that is used to draw a selection box over the graph. Instead of the annotation used in that example, just update the position of the indicator plot (change the relevant data and call
-reloadDataon the plot).