2012-12-21 34 views
1

我想隱藏軸設置餅圖使用graph.axisset = nil;但它不工作。是否有任何其他方式來刪除圖的默認軸集。核心繪圖axisset爲餅圖不工作

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

回答

1

它是graph.axisSet = nil;(注意大寫「S」)。

不要在圖表或任何其他核心繪圖層上設置borderColor。始終使用Core Plot線型和填充屬性來設置圖形各個部分的外觀。

+0

我試過像你說的,但它仍然不起作用 – karan

+0

你能提供更多的細節嗎?你如何設置圖形和情節?你是否收到任何錯誤或日誌消息? –

+0

添加了更多細節的代碼 – karan