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.
  seriesList.forEach((MutableSeries<D> series) {
    final rendererId = series.getAttr(rendererIdKey);
    rendererToSeriesList.putIfAbsent(rendererId, () => []).add(series);
  });

  // Have each renderer add missing color functions to their seriesLists.
  rendererToSeriesList
      .forEach((String? rendererId, List<MutableSeries<D>> seriesList) {
    getSeriesRenderer(rendererId).configureSeries(seriesList);
  });
}