iPad- CorePlot 0.2.2.
(void) pieChart: sliceWasSelectedAtRecordIndex: , , ,
:
:
@interface YourViewController : UIViewController < CPPieChartDataSource,
CPPieChartDelegate,
... >
{
...
CPXYGraph* pieGraph;
CPGraphHostingView* pieView;
}
@property (nonatomic, retain) IBOutlet CPGraphHostingView* pieView;
- (void)pieChart:(CPPieChart *)plot sliceWasSelectedAtRecordIndex:(NSUInteger)index;
@end
(void) viewDidLoad, :
-(void)viewDidLoad {
[self createPie];
}
-(void)createPie {
pieGraph = [[CPXYGraph alloc] initWithFrame:CGRectZero];
pieGraph.axisSet = nil;
self.pieView.hostedGraph = pieGraph;
CPPieChart *pieChart = [[CPPieChart alloc] init];
pieChart.delegate = self;
pieChart.dataSource = self;
pieChart.pieRadius = 80.0;
[pieGraph addPlot:pieChart];
[pieChart release];
}
- (void)pieChart:(CPPieChart *)plot sliceWasSelectedAtRecordIndex:(NSUInteger)index {
}