removeFrom method

  1. @override
void removeFrom(
  1. BaseChart<D> chart
)
override

Removes the behavior from a chart.

Implementation

@override
void removeFrom(BaseChart<D> chart) {
  if (chart is! CartesianChart<D>) {
    throw ArgumentError(
        'PanBehavior can only be attached to a CartesianChart<D>');
  }

  _chart = chart;
  chart.removeGestureListener(_listener);

  // Restore the default autoViewport state.
  chart.domainAxis!.autoViewport = true;

  // Restore the original tick providers
  chart.domainAxis!.tickProvider = _domainAxisTickProvider.tickProvider;

  _chart = null;
}