SChartLegendItem Protocol Reference

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

Overview

Specifies the interface required by the legend to display chart series. A series should adopt this protocol if it wishes to specify how it is represented in the legend.

The SChartSeries base class adopts this protocol and therefore any subclasses can specify their representation in the legend by overriding the methods here. All the series types provided by ShinobiCharts already provide their own implementation of these methods, so you should only need to implement them yourself if you are looking for custom behavior.

Instance Methods

blockSymbolForSeriesInLegend

Returns a solid block of color representing a cartesian series in the legend.

- (SChartLegendSymbol *)blockSymbolForSeriesInLegend

Declared In

SChartLegendItem.h

symbolForSeriesInLegend

Returns the symbol representing a cartesian series in the legend.

- (SChartLegendSymbol *)symbolForSeriesInLegend

Discussion

All of the series types provided by ShinobiCharts return an appropriate symbol to represent them in the legend. If you would like to use a custom symbol, you can subclass one of the series types, and override this method.

For radial series, you should use symbolForSliceInLegend: instead.

Declared In

SChartLegendItem.h

symbolForSliceInLegend:

Returns the symbol representing a slice in the first radial series on the chart.

- (SChartLegendSymbol *)symbolForSliceInLegend:(NSInteger)index

Discussion

All of the series types provided by ShinobiCharts return an appropriate symbol type to be used in the legend. If you would like to use a custom symbol, you can subclass one of the series types, and override this method.

For cartesian series, you should use symbolForSeriesInLegend instead.

Declared In

SChartLegendItem.h

textColorForSeriesTitleInLegend

Returns the text color used for series titles in the legend.

- (UIColor *)textColorForSeriesTitleInLegend

Discussion

By default, the text color is taken from the chart theme. If you implement this method yourself, the value it returns takes precedence.

Declared In

SChartLegendItem.h

titleForSeriesInLegend

Returns the text displayed in the legend for the series.

- (NSString *)titleForSeriesInLegend

Discussion

This is relevant for cartesian series, but is not used for radial series. For radial series, use titleForSliceInLegend.

Declared In

SChartLegendItem.h

titleForSliceInLegend:

Returns the text displayed in the legend for the slice at the given index in the first series on the chart.

- (NSString *)titleForSliceInLegend:(NSInteger)index

Parameters

index

The index of the relevant slice in the first chart series.

Discussion

This is only relevant for radial series. This method will be called for each of the slices in the first series in the chart. If this is implemented, symbolForSeriesInLegend will not be called. Instead of displaying a symbol for each series, we will display more detailed information about the first series in the chart.

Declared In

SChartLegendItem.h