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;
self.hostingView.hostedGraph = graph;
graph.axisSet = nil;
//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];
Run Code Online (Sandbox Code Playgroud)
对于这个代码我得到黑色边框,我认为这是由于graph axisSet但我不知道如何删除.
如果您所谈论的是整个图表周围出现的边框,我会说在声明后使用此代码[graph applyTheme:self.graphTheme];:
graph.plotAreaFrame.borderLineStyle = nil;
Run Code Online (Sandbox Code Playgroud)
这将完全从图形区域中删除边框.
| 归档时间: |
|
| 查看次数: |
740 次 |
| 最近记录: |