我正在尝试使用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];
答案 0 :(得分:1)
它是graph.axisSet = nil;
(注意大写“S”)。
不要在图表或任何其他Core Plot图层上设置borderColor
。始终使用Core Plot线条样式和填充属性来设置图形各部分的外观。