gpt4 book ai didi

iphone - 如何在核心图中旋转 CPTGraphhostingview

转载 作者:行者123 更新时间:2023-11-29 04:54:41 25 4
gpt4 key购买 nike

请指导我如何通过单指触摸在两个(时钟和反时钟)方向上旋转 CPTGraphHostingView

谢谢

最佳答案

//我已使用此代码在没有用户交互的情况下旋转饼图几秒钟。

-(void)ConstPieChart
{
graph = [[CPXYGraph alloc] initWithFrame: CGRectZero];

viewGraphHostingPie.hostedGraph=graph;

CPPieChart *pieChart = [[CPPieChart alloc] init];
pieChart.dataSource = self;
pieChart.delegate = self;
pieChart.pieRadius = 100.0;
pieChart.identifier = @"PieChart1";
pieChart.startAngle=0;
//pieChart.startAngle = M_PI_4;
pieChart.sliceDirection = CPPieDirectionCounterClockwise;



NSMutableArray *ValueArray = [[NSMutableArray alloc]init];
ValueArray = [NSArray arrayWithObjects:[NSNumber numberWithDouble:57.03],[NSNumber numberWithDouble:66.00],[NSNumber numberWithDouble:77.03],nil];
self.pieData = ValueArray;




CABasicAnimation *rotation = [CABasicAnimation animationWithKeyPath:@"transform"];
CATransform3D transform = CATransform3DMakeRotation(360, 0, 0, 1);
rotation.toValue = [NSValue valueWithCATransform3D:transform];
rotation.duration = 15.0f;
[pieChart addAnimation:rotation forKey:@"rotation"];
[graph addPlot:pieChart];
[pieChart release];
}

关于iphone - 如何在核心图中旋转 CPTGraphhostingview,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8224519/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com