CPTPlotspace 注釈を使用して、グラフに 1 つの画像を追加しました。コードは次のとおりです。
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];
結果は以下のリンクに記載されています。
さて、問題は、データラインに沿って画像(グラフ上の黒いマーカー)をドラッグするにはどうすればよいですか?