在核心图中出现黑色方形边框


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,但我不知道如何删除。

如果你说的是出现在整个图形周围的边界框,我会说在语句[graph applyTheme:self.graphTheme];:

之后使用这段代码
graph.plotAreaFrame.borderLineStyle = nil;

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

最新更新