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) {
  seriesList.forEach((MutableSeries<D> series) {
    if (series.data.isEmpty) {
      return;
    }

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

    if (domainAxis == null) {
      return;
    }

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

    // 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);
  });
}