2012-06-02 118 views
2

爲什麼Core Plot繪製這兩條線?Core Plot上的奇怪邊框餅圖

ios graph

這是我如何建立圖表:

// setup the pie chart 
graph = [[CPTXYGraph alloc] initWithFrame:[_pieView bounds]]; 
[_pieView setHostedGraph:graph]; 

CPTPieChart *pieChart = [[CPTPieChart alloc] init]; 
[pieChart setDataSource:self]; 
[pieChart setPieRadius:75.0]; 
[pieChart setIdentifier:@"PieChart1"]; 
[pieChart setStartAngle:M_PI_4]; 
[pieChart setSliceDirection:CPTPieDirectionClockwise]; 

[graph addPlot:pieChart]; 

_pieViewCPTGraphHostingView*

如何去除兩條黑線?我試圖做How do remove the border around a core-plot graph中描述的,無濟於事。

回答

5

這不是邊框 - 它是CPTXYGraph附帶的默認軸。這是一行代碼刪除它們:

graph.axisSet = nil; 
+0

啊,我想這是有道理的......我不知何故忘了我用'CPTXYGraph'來保存餅圖。不管怎樣,謝謝 :) – houbysoft