1

我正在尝试隐藏饼图的轴集,graph.axisset = nil;但它不起作用。有没有其他方法可以删除图形的默认轴集。

CPTXYGraph *graph = [[CPTXYGraph alloc]initWithFrame:self.hostingView.frame];
graph.borderColor = [CPTColor whiteColor].cgColor;
graph.paddingTop = 0.0f;
graph.paddingRight = 0.0f;
graph.paddingLeft = 0.0f;
graph.paddingBottom = 0.0f;
graph.axisSet = nil;
self.hostingView.hostedGraph = graph;

//Apply for theme to graph
self.graphTheme = [CPTTheme themeNamed:kCPTPlainWhiteTheme];
[graph applyTheme:self.graphTheme];
[graph release];
CPTPieChart *pieChart = [[CPTPieChart alloc]init];
pieChart.identifier = @"OverView";
pieChart.dataSource = self;
pieChart.sliceDirection = CPTPieDirectionClockwise;
pieChart.pieRadius = ((self.hostingView.frame.size.height  / 2) - 5);
pieChart.startAngle = M_PI;
CPTGraph *tempGraph = self.hostingView.hostedGraph;
[tempGraph addPlot:pieChart];
[pieChart release];
4

1 回答 1

1

它是graph.axisSet = nil;(注意大写的“S”)。

不要borderColor在图表或任何其他 Core Plot 图层上设置 。始终使用 Core Plot 线条样式和填充属性来设置图形各个部分的外观。

于 2012-12-21T23:12:20.973 回答