YLPieChartDataSource Protocol Reference
Conforms to | NSObject |
Declared in | YLPieChartDataSource.h |
Overview
You must implement this protocol to supply the necessary data information to YLPieChartView.
Tasks
-
– numberOfSlicesInPieChartView:
Return the number of slices in the pie chart.
required method -
– pieChartView:valueForSliceAtIndex:
Return the value for a specific pie slice. You don’t need to worry about normalized values since YLPieChartView will normalize the values internally while drawing the pie chart.
required method -
– pieChartView:colorForSliceAtIndex:
Return the color that should be used for a specific pie slice. If you return nil or don’t implement this method YLPieChartView will auto-generate a color.
-
– showSingleSliceInPieChartView:
Return YES if you only want to display a single pie slice. Have a look at YLPieSliceChartView how this is used.
Instance Methods
numberOfSlicesInPieChartView:
Return the number of slices in the pie chart.
- (NSUInteger)numberOfSlicesInPieChartView:(YLPieChartView *)pieChartView
Parameters
- pieChartView
The YLPieChartView instance.
Return Value
Number of slices in the pie chart.
Discussion
Return the number of slices in the pie chart.
Declared In
YLPieChartDataSource.h
pieChartView:colorForSliceAtIndex:
Return the color that should be used for a specific pie slice. If you return nil or don’t implement this method YLPieChartView will auto-generate a color.
- (UIColor *)pieChartView:(YLPieChartView *)pieChartView colorForSliceAtIndex:(NSUInteger)index
Return Value
Color for the pie slice.
Discussion
Return the color that should be used for a specific pie slice. If you return nil or don’t implement this method YLPieChartView will auto-generate a color.
Declared In
YLPieChartDataSource.h
pieChartView:valueForSliceAtIndex:
Return the value for a specific pie slice. You don’t need to worry about normalized values since YLPieChartView will normalize the values internally while drawing the pie chart.
- (CGFloat)pieChartView:(YLPieChartView *)pieChartView valueForSliceAtIndex:(NSUInteger)index
Return Value
Value for the pie slice.
Discussion
Return the value for a specific pie slice. You don’t need to worry about normalized values since YLPieChartView will normalize the values internally while drawing the pie chart.
Declared In
YLPieChartDataSource.h
showSingleSliceInPieChartView:
Return YES if you only want to display a single pie slice. Have a look at YLPieSliceChartView how this is used.
- (BOOL)showSingleSliceInPieChartView:(YLPieChartView *)pieChartView
Parameters
- pieChartView
The YLPieChartView instance.
Return Value
Boolean value that indicates wether only a single pie slice will be displayed.
Discussion
Return YES if you only want to display a single pie slice. Have a look at YLPieSliceChartView how this is used.
Declared In
YLPieChartDataSource.h