Core Plot (iOS and tvOS)
Cocoa plotting framework for macOS, iOS, and tvOS
<CPTPieChartDataSource> Protocol Reference

A pie chart data source. More...

#import <CPTPieChart.h>

+ Inheritance diagram for <CPTPieChartDataSource>:
+ Collaboration diagram for <CPTPieChartDataSource>:

Public Instance Methods

Slice Style
(nullable CPTFillArray *) - sliceFillsForPieChart:recordIndexRange:
 (Optional) Gets a range of slice fills for the given pie chart. More...
 
(nullable CPTFill *) - sliceFillForPieChart:recordIndex:
 (Optional) Gets a fill for the given pie chart slice. This method will not be called if -sliceFillsForPieChart:recordIndexRange: is also implemented in the datasource. More...
 
Slice Layout
(nullable CPTNumberArray *) - radialOffsetsForPieChart:recordIndexRange:
 (Optional) Gets a range of slice offsets for the given pie chart. More...
 
(CGFloat- radialOffsetForPieChart:recordIndex:
 (Optional) Offsets the slice radially from the center point. Can be used to “explode” the chart. This method will not be called if -radialOffsetsForPieChart:recordIndexRange: is also implemented in the datasource. More...
 
Legends
(nullable NSString *) - legendTitleForPieChart:recordIndex:
 (Optional) Gets the legend title for the given pie chart slice. More...
 
(nullable NSAttributedString *) - attributedLegendTitleForPieChart:recordIndex:
 (Optional) Gets the styled legend title for the given pie chart slice. More...
 
- Public Instance Methods inherited from <CPTPlotDataSource>
(NSUInteger- numberOfRecordsForPlot:
 (Required) The number of data points for the plot. More...
 
(nullable NSArray *) - numbersForPlot:field:recordIndexRange:
 (Optional) Gets a range of plot data for the given plot and field. Implement one and only one of the optional methods in this section. More...
 
(nullable id- numberForPlot:field:recordIndex:
 (Optional) Gets a plot data value for the given plot and field. Implement one and only one of the optional methods in this section. More...
 
(nullable double *) - doublesForPlot:field:recordIndexRange:
 (Optional) Gets a range of plot data for the given plot and field. Implement one and only one of the optional methods in this section. More...
 
(double) - doubleForPlot:field:recordIndex:
 (Optional) Gets a plot data value for the given plot and field. Implement one and only one of the optional methods in this section. More...
 
(nullable CPTNumericData *) - dataForPlot:field:recordIndexRange:
 (Optional) Gets a range of plot data for the given plot and field. Implement one and only one of the optional methods in this section. More...
 
(nullable CPTNumericData *) - dataForPlot:recordIndexRange:
 (Optional) Gets a range of plot data for all fields of the given plot simultaneously. Implement one and only one of the optional methods in this section. More...
 
(nullable CPTLayerArray *) - dataLabelsForPlot:recordIndexRange:
 (Optional) Gets a range of data labels for the given plot. More...
 
(nullable CPTLayer *) - dataLabelForPlot:recordIndex:
 (Optional) Gets a data label for the given plot. This method will not be called if -dataLabelsForPlot:recordIndexRange: is also implemented in the datasource. More...
 
- Public Instance Methods inherited from <NSObject>
(NSString *) - description
 
(NSUInteger- hash
 
(BOOL- isEqual:
 

Detailed Description

A pie chart data source.

Method Documentation

◆ attributedLegendTitleForPieChart:recordIndex:

- (nullable NSAttributedString *) attributedLegendTitleForPieChart: (nonnull CPTPieChart *)  pieChart
recordIndex: (NSUInteger idx 

(Optional) Gets the styled legend title for the given pie chart slice.

Parameters
pieChartThe pie chart.
idxThe data index of interest.
Returns
The styled title text for the legend entry for the point with the given index.

◆ legendTitleForPieChart:recordIndex:

- (nullable NSString *) legendTitleForPieChart: (nonnull CPTPieChart *)  pieChart
recordIndex: (NSUInteger idx 

(Optional) Gets the legend title for the given pie chart slice.

Parameters
pieChartThe pie chart.
idxThe data index of interest.
Returns
The title text for the legend entry for the point with the given index.

◆ radialOffsetForPieChart:recordIndex:

- (CGFloat) radialOffsetForPieChart: (nonnull CPTPieChart *)  pieChart
recordIndex: (NSUInteger idx 

(Optional) Offsets the slice radially from the center point. Can be used to “explode” the chart. This method will not be called if -radialOffsetsForPieChart:recordIndexRange: is also implemented in the datasource.

Parameters
pieChartThe pie chart.
idxThe data index of interest.
Returns
The radial offset in view coordinates. Zero is no offset.

◆ radialOffsetsForPieChart:recordIndexRange:

- (nullable CPTNumberArray *) radialOffsetsForPieChart: (nonnull CPTPieChart *)  pieChart
recordIndexRange: (NSRange indexRange 

(Optional) Gets a range of slice offsets for the given pie chart.

Parameters
pieChartThe pie chart.
indexRangeThe range of the data indexes of interest.
Returns
An array of radial offsets.

◆ sliceFillForPieChart:recordIndex:

- (nullable CPTFill *) sliceFillForPieChart: (nonnull CPTPieChart *)  pieChart
recordIndex: (NSUInteger idx 

(Optional) Gets a fill for the given pie chart slice. This method will not be called if -sliceFillsForPieChart:recordIndexRange: is also implemented in the datasource.

Parameters
pieChartThe pie chart.
idxThe data index of interest.
Returns
The pie slice fill for the slice with the given index. If the datasource returns nil, the default fill is used. If the data source returns an NSNull object, no fill is drawn.

◆ sliceFillsForPieChart:recordIndexRange:

- (nullable CPTFillArray *) sliceFillsForPieChart: (nonnull CPTPieChart *)  pieChart
recordIndexRange: (NSRange indexRange 

(Optional) Gets a range of slice fills for the given pie chart.

Parameters
pieChartThe pie chart.
indexRangeThe range of the data indexes of interest.
Returns
An array of pie slice fills.

The documentation for this protocol was generated from the following file: