A plot data source.
More...
#import <CPTPlot.h>
◆ 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.
- Parameters
-
plot | The plot. |
fieldEnum | The field index. |
indexRange | The range of the data indexes of interest. |
- Returns
- A one-dimensional array of data points.
◆ 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.
The data returned from this method should be a two-dimensional array. It can be arranged in row- or column-major order although column-major will load faster, especially for large arrays. The array should have the same number of rows as the length of indexRange
. The number of columns should be equal to the number of plot fields required by the plot. The column index (zero-based) corresponds with the field index. The data type will be converted to match the cachePrecision if needed.
- Parameters
-
plot | The plot. |
indexRange | The range of the data indexes of interest. |
- Returns
- A two-dimensional array of data points.
◆ 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.
- Parameters
-
plot | The plot. |
idx | The data index of interest. |
- Returns
- The data label for the point with the given index. If you return nil, the default data label will be used. If you return an instance of NSNull, no label will be shown for the index in question.
◆ dataLabelsForPlot:recordIndexRange:
(Optional) Gets a range of data labels for the given plot.
- Parameters
-
plot | The plot. |
indexRange | The range of the data indexes of interest. |
- Returns
- An array of data labels.
◆ 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.
- Parameters
-
plot | The plot. |
fieldEnum | The field index. |
idx | The data index of interest. |
- Returns
- A data point.
◆ doublesForPlot:field:recordIndexRange:
- (nullable double *) doublesForPlot: |
|
(nonnull CPTPlot *) |
plot |
field: |
|
(NSUInteger) |
fieldEnum |
recordIndexRange: |
|
(NSRange) |
indexRange |
|
|
| |
|
optional |
(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.
- Parameters
-
plot | The plot. |
fieldEnum | The field index. |
indexRange | The range of the data indexes of interest. |
- Returns
- A retained C array of data points.
◆ 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.
For fields where the plotSpace scale type is CPTScaleTypeCategory, this method should return an NSString containing the category name. Otherwise, it should return an NSNumber holding the data value. For any scale type, return nil or an instance of NSNull to indicate missing values.
- Parameters
-
plot | The plot. |
fieldEnum | The field index. |
idx | The data index of interest. |
- Returns
- A data point.
◆ numberOfRecordsForPlot:
(Required) The number of data points for the plot.
- Parameters
-
- Returns
- The number of data points for the plot.
◆ 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.
For fields where the plotSpace scale type is CPTScaleTypeCategory, this method should return an array of NSString objects containing the category names. Otherwise, it should return an array of NSNumber objects holding the data values. For any scale type, include instances of NSNull in the array to indicate missing values.
- Parameters
-
plot | The plot. |
fieldEnum | The field index. |
indexRange | The range of the data indexes of interest. |
- Returns
- An array of data points.
The documentation for this protocol was generated from the following file: