1
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];

对于此代码,我得到黑色边框,我认为这是由于图形 axisSet 但我不知道如何删除。

4

1 回答 1

8

如果您正在谈论的是出现在整个图形周围的边框框,我会说在语句之后使用此代码[graph applyTheme:self.graphTheme];

graph.plotAreaFrame.borderLineStyle = nil;

这将从图形区域中完全删除边框。

于 2013-02-08T15:31:20.313 回答