0
IM通過下面的代碼旋轉的餅圖停止餅圖
-(BOOL)plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceDownEvent:(id)event atPoint:(CGPoint)point
{
CABasicAnimation *rotation = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
rotation.removedOnCompletion = NO;
rotation.fromValue = [NSNumber numberWithFloat:M_PI_4];
rotation.toValue = [NSNumber numberWithFloat:M_PI_4+10];
rotation.duration = 1.0f;
rotation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault];
rotation.delegate = self;
pieChart.startAngle = M_PI_4+10;
[pieChart addAnimation:rotation forKey:@"rotation"];
return YES;
}
但是旋轉的餅圖後回到其初始position.But我想,現在餅圖應該在轉角。如何在這裏取得成功?