Iphone CorePlot:如何在图形中拖动图像

Iphone CorePlot:如何在图形中拖动图像,iphone,core-plot,Iphone,Core Plot,在CPTPlotspace注释的帮助下,我在我的图形中添加了一个图像 UIImage *image=[UIImage imageNamed:@"marker.gif"]; CPTImage *fillimage=[CPTImage imageWithCGImage:image.CGImage]; CPTBorderedLayer *imageLayer = [[CPTBorderedLayer alloc]init]; imageLayer.frame=CGRectMake(0, 0, 10,

在CPTPlotspace注释的帮助下,我在我的图形中添加了一个图像

UIImage *image=[UIImage imageNamed:@"marker.gif"];
CPTImage *fillimage=[CPTImage imageWithCGImage:image.CGImage];
CPTBorderedLayer *imageLayer = [[CPTBorderedLayer alloc]init];
imageLayer.frame=CGRectMake(0, 0, 10, 10);
imageLayer.fill=[CPTFill fillWithImage:fillimage];  
CPTPlotSpaceAnnotation *imageannotation  = [[CPTPlotSpaceAnnotation alloc] initWithPlotSpace:graph.defaultPlotSpace anchorPlotPoint:anchorPoint];
imageannotation.contentLayer = imageLayer;
[graph.plotAreaFrame.plotArea addAnnotation:imageannotation];
结果在下面的链接中给出


现在,问题是如何沿数据线拖动图像(图形上的黑色标记)?

是否要在用户触摸的位置添加带有相应x和y值的注释?@BlackPearl否,我想沿着绘制的图形拖动图像。您可以在图形中看到黑点。我想让它充当可以拖动的点标记。您可以重写此方法-(BOOL)pointingDeviceDraggedEvent:(id)event atPoint:(CGPoint)CPTGraph类的interactionPoint以标识拖动,并可以在指定点添加注释。