configureMeasureAxes method

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

Adds the measure values for the given series to the chart's measure axes.

Implementation

@override
void configureMeasureAxes(List<MutableSeries<D>> seriesList) {
  for (final series in seriesList) {
    if (series.data.isEmpty) {
      continue;
    }

    final domainAxis = series.getAttr(domainAxisKey) as Axis<D>?;
    final domainFn = series.domainFn;

    if (domainAxis == null) {
      continue;
    }

    final measureAxis = series.getAttr(measureAxisKey) as Axis<num>?;
    if (measureAxis == null) {
      continue;
    }

    // Only add the measure values for datum who's domain is within the
    // domainAxis viewport.
    final startIndex =
        findNearestViewportStart(domainAxis, domainFn, series.data);
    final endIndex =
        findNearestViewportEnd(domainAxis, domainFn, series.data);

    addMeasureValuesFor(series, measureAxis, startIndex, endIndex);
  }
}