This class can be used to easily setup your chart with series and simple data.
SChartSimpleDatasource implements the
SChartDatasource protocol and must be assigned to a chart’s datasource to take effect.
The series & data you have added to this
SChartSimpleDatasource will be passed to and displayed by the chart it’s been assigned to.
Add a series and its corresponding array of
data to be displayed on the chart which this
SChartSimpleDatasource has been added to.
- (void)addSeries:(SChartSeries *)series dataArray:(NSArray *)data
An array of
SChartDataPoints or NSNumber objects.
data array can either be an array of
SChartDataPoints or NSNumber objects. If it is an array of NSNumber objects they will be automatically translated into an array of
SChartDataPoint objects. The array index will be used as the X value, with the NSNumber used as the Y value. Note: the assignment to X and Y values will be reversed if the series orientation is set to vertical.
data parameters will be validated before being added. If either of the parameters are nil the chart will log a warning and not add the series.