我在核心情节的分散情节中工作。当我触摸该图中任何绘制的点时,我需要显示一些与该触摸点相关的信息。
我怎样才能做到这一点?
提前致谢。
答案 0 :(得分:2)
这些委托方法帮助了我。
-(BOOL)plotSpace:(CPTXYPlotSpace *)space shouldHandlePointingDeviceUpEvent:(id)event atPoint:(CGPoint)point{
NSLog(@"point.x=%lf,point.y=%lf",point.x,point.y);
return YES;
}
-(BOOL)plotSpace:(CPTXYPlotSpace *)space shouldHandlePointingDeviceCancelledEvent:(id)event{
//NSLog(@"point.x=%lf,point.y=%lf",point.x,point.y);
return YES;
}
-(BOOL)plotSpace:(CPTXYPlotSpace *)space shouldHandlePointingDeviceDownEvent:(id)event atPoint:(CGPoint)point{
NSLog(@"point.x=%lf,point.y=%lf",point.x,point.y);
return YES;
}
-(BOOL)plotSpace:(CPTXYPlotSpace *)space shouldHandlePointingDeviceDraggedEvent:(id)event atPoint:(CGPoint)point{
NSLog(@"point.x=%lf,point.y=%lf",point.x,point.y);
return YES;
}
答案 1 :(得分:0)
Core Plot附带的示例应用程序显示了几种不同的方法。在Plot Gallery应用程序中,查看渐变散点图或简单散点图。 Mac版CPTTestApp有一个点选择演示,它显示了在所选点而不是标签上绘制十字准线的一种方法。