public interface

SeriesStyleProvider

com.shinobicontrols.charts.SeriesStyleProvider<T extends com.shinobicontrols.charts.SeriesStyle>

Class Overview

Provides a concrete SeriesStyle implementation based on the properties of a given Data and Series, allowing individual point styling of a Series.

The SeriesStyleProvider is asked for the SeriesStyle to use for each data point in the Series. This allows you to provide a custom implementation that returns a specific style based on the properties of an individual data point.

For Series that support it, you can apply a SeriesStyleProvider by calling the Series#setSeriesStyleProvider(SeriesStyleProvider) method. You can also obtain the default SeriesStyleProvider for a particular Series type by using the createDefaultSeriesStyleProvider() method, allowing you access to the usual styling behavior and the ability to compose it with your own custom styling rules.

Note, the SeriesStyle objects returned by this SeriesStyleProvider are only used for styling properties that are applicable per-point, not on a per-series basis.

Summary

Public Methods
abstract <S extends Series<T extends SeriesStyle>> T provide(Data<?, ?> data, int index, S series)
Provides a concrete SeriesStyle implementation based on the properties of the given Data and Series.

Public Methods

public abstract T provide (Data<?, ?> data, int index, S series)

Provides a concrete SeriesStyle implementation based on the properties of the given Data and Series.

As a convenience the index of the Data in the Series' getDataPointsForDisplay() list is also provided. This then allows you to perform such checks as isPointSelected(int) for the Data without having to ask the DataAdapter for its index.

Note that allocations and computationally expensive operations performed here will increase render time. Therefore, it is recommended that you create all the required SeriesStyle objects in advance where possible, rather than instantiating them in this method.

Parameters
data the specific Data in the Series' DataAdapter for which to provide a SeriesStyle
index the index of the Data in the Series' getDataPointsForDisplay() list
series the Series containing the given Data and for which the returned SeriesStyle is applicable
Returns