Question

I implement the following function and I set CPTScatterPlot delegate to self and boundLinePlot.plotSymbolMarginForHitDetection to 320.0f.

-(void)scatterPlot:(CPTScatterPlot *)plot plotSymbolWasSelectedAtRecordIndex:(NSUInteger)index {
    NSLog(@"index %d",index);
}

When i touch the scatterplot graph anywhere the delegate method run correctly and return the nearest index, but the scroll don't working because the delegate method catches all taps.

how to solve this problem?

Thanks for the replies

Was it helpful?

Solution

Reduce your plotSymbolMarginForHitDetection setting. You've told it to register a touch anywhere within 320 pixels of a plot point. On an iPhone screen, that's pretty much the whole graph. A more typical setting would be somewhere between 5 and 15.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top