我用图像填充piePlot的覆盖,而不是用渐变颜色填充。
代码如下:
piePlot.pieRadius = radius;
piePlot.identifier = @"1";
piePlot.startAngle = 0.0;
piePlot.sliceDirection = CPTPieDirectionCounterClockwise;
piePlot.borderLineStyle = [CPTLineStyle lineStyle];
piePlot.labelOffset = 5.0;
piePlot.overlayFill = [CPTFill fillWithImage:[CPTImage imageWithCGImage:[UIImage imageNamed:@"pointerPie.png"].CGImage]];
piePlot.centerAnchor = CGPointMake(0.5, 0.5);这里的问题只是覆盖图像的一部分,而不是完整的图像。如果我用任何其他颜色填充它,它工作得很好。
我做错了什么。有人能告诉我我在哪里做错了什么吗?
发布于 2013-10-25 23:43:13
您需要设置图像填充的scale,以便正确绘制。您可以在创建CPTImage时执行此操作
UIImage *image = [UIImage imageNamed:@"pointerPie.png"];
piePlot.overlayFill = [CPTFill fillWithImage:[CPTImage imageWithCGImage:image.CGImage
scale:image.scale]];https://stackoverflow.com/questions/19559366
复制相似问题