문제

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