質問

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

役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top