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) {
  assignMissingColors(seriesList, emptyCategoryUsesSinglePalette: false);

  seriesList.forEach((series) {
    // Add a default area color function which applies the configured
    // areaOpacity value to the datum's current color.
    series.areaColorFn ??= (int? index) {
      final color = series.colorFn?.call(index);
      if (color == null) {
        return null;
      }

      return Color(
          r: color.r,
          g: color.g,
          b: color.b,
          a: (color.a * config.areaOpacity).round());
    };
  });

  if (config.includePoints) {
    _pointRenderer.configureSeries(seriesList);
  }
}