我在CPTPlotspace annotation的帮助下将一个图像添加到我的图形中。编码如下
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];
结果在下面的链接中给出。
现在,问题是我如何沿数据线拖动图像(图表上的黑色标记)?