2012-05-23 103 views

回答

0

是,克里希納。您可以將多個餅圖添加到同一圖表中,如下所示:

CPTGraphHostingView *hostingView = (CPTGraphHostingView *) self; 
CPTXYGraph  *graph; 
// set up the graph parameters 
... 
... 
hostingView.hostedGraph   = graph; 
// Pie chart 1 
CPTPieChart *pieChart1   = [[CPTPieChart alloc] init]; 
// Pie Chart 2 
CPTPieChart *pieChart2   = [[CPTPieChart alloc] init]; 

// Add them to the graph 
[graph addPlot:pieChart1]; 
[graph addPlot:pieChart2];