flatronka
flatronka

Reputation: 1081

CorePlot touch recognition scrolling

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

Upvotes: 0

Views: 452

Answers (1)

Eric Skroch
Eric Skroch

Reputation: 27381

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.

Upvotes: 1

Related Questions