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) {
    throw ArgumentError(
      'InitialHintBehavior can only be removed from a CartesianChart<D>',
    );
  }

  stopHintAnimation();

  _chart = chart as CartesianChart<D>;
  chart
    ..removeGestureListener(_listener)
    ..removeLifecycleListener(_lifecycleListener);

  _chart = null;
}