How do I animate the appearance of a bar chart in Core Plot?

前端 未结 5 2258
一生所求
一生所求 2021-02-10 06:49

When first displaying a bar chart using Core Plot, I\'d like the bars to grow upward until they reach their correct heights.

How would you create such an animation usi

5条回答
  •  猫巷女王i
    2021-02-10 06:56

    Add opacity animation like this...

    CABasicAnimation *fadeInAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"];
    fadeInAnimation.duration = 1.0f;
    fadeInAnimation.removedOnCompletion = NO;
    fadeInAnimation.fillMode = kCAFillModeForwards;
    fadeInAnimation.toValue = [NSNumber numberWithFloat:1.0];
    [xSquaredPlot addAnimation:fadeInAnimation forKey:@"animateOpacity"];
    

提交回复
热议问题