configureSeries method

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

Preprocess series to assign missing color functions.

Implementation

void configureSeries(List<MutableSeries<D>> seriesList) {
  final rendererToSeriesList = <String?, List<MutableSeries<D>>>{};

  // Build map of rendererIds to SeriesLists. This map can't be re-used later
  // in the preprocessSeries call because some behaviors might alter the
  // seriesList.
  for (final series in seriesList) {
    final rendererId = series.getAttr(rendererIdKey);
    rendererToSeriesList.putIfAbsent(rendererId, () => []).add(series);
  }

  // Have each renderer add missing color functions to their seriesLists.
  rendererToSeriesList.forEach((rendererId, seriesList) {
    getSeriesRenderer(rendererId).configureSeries(seriesList);
  });
}