1

I am trying to hide axis set for pie chart using graph.axisset = nil; but it is not working. Is there any other way to remove default axisset of graph.

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];
iDev
  • 23,310
  • 7
  • 60
  • 85
karan
  • 335
  • 4
  • 13

1 Answers1

1

It's graph.axisSet = nil; (note the capital "S").

Don't set the borderColor on the graph or any other Core Plot layer. Always use the Core Plot line style and fill properties to set the appearance of the various parts of the graph.

Eric Skroch
  • 27,381
  • 3
  • 29
  • 36
  • Can you provide more detail? How are you setting up the graph and plot? Are you getting any errors or log messages? – Eric Skroch Dec 24 '12 at 12:20