configureSeries method

  1. @override
void configureSeries(
  1. List<MutableSeries<D>> seriesList
)

Performs basic configuration for the series, before it is pre-processed.

Typically, a series renderer should assign color mapping functions to series that do not have them.

Implementation

@override
void configureSeries(List<MutableSeries<D>> seriesList) {
  for (final series in seriesList) {
    series.colorFn ??= (_) => _color;
    series.fillColorFn ??= (_) => _color;

    // Fill in missing seriesColor values with the color of the first datum in
    // the series. Note that [Series.colorFn] should always return a color.
    if (series.seriesColor == null) {
      try {
        series.seriesColor = series.colorFn!(0);
      } catch (exception) {
        series.seriesColor = _color;
      }
    }
  }
}