我使用Core Plot在iPad应用程序中有一个散点图,并且一切正常。我想做的是对线的绘制进行动画处理,以使图形上的每个点到点都看起来像在用户面前绘制。我不希望淡入淡出,因为我已经做好了这项工作。

我已经看到下面的问题非常相似,但是我不完全理解答案。
Core-Plot - animating a CPScatterPlot

请记住,我是Core Plot的新手,仅使用了一天左右。

谢谢

最佳答案

self.plot.anchorPoint = CGPointMake(0.0, 0.0); // Moved anchor point,

CABasicAnimation *scaling = [CABasicAnimation
                                 animationWithKeyPath:@"transform.scale.y"]; // s
scaling.fromValue = [NSNumber numberWithFloat:0.0];
scaling.toValue = [NSNumber numberWithFloat:1.0];
scaling.duration = 0.1f; // Duration
scaling.removedOnCompletion = NO;
scaling.fillMode = kCAFillModeForwards;
[self.plot addAnimation:scaling forKey:@"scaling"];

09-16 01:41