我需要在缩放绘图后更改数据源,我可以在缩放完成后以某种方式进行拦截吗?
我设置了allowsUserInteraction=YES,所以我可以平移和缩放,但我没有找到处理此事件的方法。
您可以使用绘图空间委托来观察绘图范围。当范围满足您设置的阈值时,更改数据源。
以下是正确的方法:
- (BOOL) plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceDraggedEvent:(id)event atPoint:(CGPoint)point
- (BOOL) plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceDownEvent:(id)event atPoint:(CGPoint)point
- (BOOL) plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceUpEvent:(id)event atPoint:(CGPoint)point {
- (BOOL) plotSpace:(CPTPlotSpace *)space shouldScaleBy:(CGFloat)interactionScale aboutPoint:(CGPoint)interactionPoint