Pergunta

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

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top