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];
我試過像你說的,但它仍然不起作用 – karan
你能提供更多的細節嗎?你如何設置圖形和情節?你是否收到任何錯誤或日誌消息? –
添加了更多細節的代碼 – karan