populateChartPoints method

  1. @override
void populateChartPoints({
  1. List<ChartDataPointType>? positions,
  2. List<List<num>>? yLists,
})
override

Method excepts BoxAndWhiskerSeries, and stacking series.

Implementation

@override
void populateChartPoints({
  List<ChartDataPointType>? positions,
  List<List<num>>? yLists,
}) {
  chartPoints.clear();
  if (parent == null || yLists == null || yLists.isEmpty) {
    return;
  }

  if (parent!.onDataLabelRender == null &&
      parent!.onTooltipRender == null &&
      dataLabelSettings.builder == null) {
    return;
  }

  yLists = <List<num>>[
    minimumValues,
    maximumValues,
    lowerValues,
    upperValues,
    medianValues,
    meanValues,
  ];
  positions = <ChartDataPointType>[
    ChartDataPointType.low,
    ChartDataPointType.high,
    ChartDataPointType.open,
    ChartDataPointType.close,
    ChartDataPointType.median,
    ChartDataPointType.mean,
  ];
  final int yLength = yLists.length;
  if (positions.length != yLength) {
    return;
  }

  for (int i = 0; i < dataCount; i++) {
    final num xValue = xValues[i];
    final CartesianChartPoint<D> point =
        CartesianChartPoint<D>(x: xRawValues[index], xValue: xValue);
    for (int j = 0; j < yLength; j++) {
      point[positions[j]] = yLists[j][i];
    }
    point[ChartDataPointType.outliers] = outliersValues[i];
    chartPoints.add(point);
  }
}