CorePlot饼图:如何隐藏X和Y轴?

时间:2012-03-24 10:02:13

标签: ios core-plot pie-chart

以下代码中的饼图CorePlot in ios:

CPTGraphHostingView *hostingView = [[CPTGraphHostingView alloc] initWithFrame:self.view.bounds];
    [self.view addSubview:hostingView];

    graph = [[CPTXYGraph alloc] initWithFrame:self.view.bounds];
    hostingView.hostedGraph = graph;

    CPTPieChart *pieChart = [[CPTPieChart alloc] init];
    pieChart.dataSource = self;
    pieChart.pieRadius = 100.0;
    pieChart.identifier = @"PieChart1";
    pieChart.startAngle = M_PI_4;
    pieChart.sliceDirection = CPTPieDirectionCounterClockwise;
    self.pieData=  [NSMutableArray arrayWithObjects:[NSNumber numberWithDouble:90.0], 
                    [NSNumber numberWithDouble:20.0],
                    [NSNumber numberWithDouble:30.0],
                    [NSNumber numberWithDouble:40.0],
                    [NSNumber numberWithDouble:50.0], [NSNumber numberWithDouble:60.0], nil];
    [graph addPlot:pieChart];
    [pieChart release];

输出不会隐藏饼图中的x和y轴....! 我需要隐藏X和y轴......! 帮助我....!

1 个答案:

答案 0 :(得分:8)

执行此操作的最佳方法是完全移除轴。

graph.axisSet = nil;