SChartData Protocol Reference

Conforms to NSObject
Declared in SChartData.h
Availability Standard
Premium
Related samples

Overview

The SChartData protocol allows any object to act as a datapoint within a series on a ShinobiChart. The [SChartDatasource sChart:dataPointAtIndex:forSeriesAtIndex:] method returns an object that implements this protocol. It can be your own object or an instance of the SChartDataPoint class that we supply.

The protocol has two required methods, which return the x and y values for the object. Radial data points return the name of the data point as the x value, and the value of the data point as the y value.

It also has a set of optional methods and properties, which allow you to:

Tasks

Single value points

Axis independent values

Multi value points

Index

Properties

sChartDataPointIndex

Returns the index of this data point in the chart series which contains it.

@property (nonatomic) NSInteger sChartDataPointIndex

Declared In

SChartData.h

Instance Methods

sChartValueForKey:

This is used for series that require data values which are independent of the axes. The expected keys can be found on the series that is trying to render the data point.

- (nullable id)sChartValueForKey:(NSString *)key

Discussion

An example of this is SChartBubbleDataPoint which has a third data value relating to the size of the bubbles.

Declared In

SChartData.h

sChartXValue

Returns the x value of the data point.

- (nullable id)sChartXValue

Discussion

This is used for series that require only a single x value. Series that require multiple x values should implement sChartXValueForKey: and check the specific series class for the required keys.

Declared In

SChartData.h

sChartXValueForKey:

Returns the x value corresponding to the provided key.

- (nullable id)sChartXValueForKey:(NSString *)key

Discussion

This is only required for series with more than one x value and keys are specified on the series type. For example, OHLC keys include “low”, “high”, etc. For series with just a single x value, use sChartXValue instead.

Declared In

SChartData.h

sChartYValue

Returns the y value of the data point.

- (nullable id)sChartYValue

Discussion

This is used for series that require only a single y value. Series that require multiple y values should implement sChartYValueForKey: and check the specific series class for the required keys.

Declared In

SChartData.h

sChartYValueForKey:

Returns the y value corresponding to the provided key.

- (nullable id)sChartYValueForKey:(NSString *)key

Discussion

This is only required for series with more than one y value and keys are specified on the series type. For example, OHLC keys include “low”, “high”, etc. For series with just a single y value, use sChartYValue instead.

Declared In

SChartData.h