onAttach method

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

Handles any setup of the renderer that needs to be deferred until it is attached to a chart.

Implementation

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

  _chart = chart;

  // Only vertical rendering is supported by this behavior.
  assert(_chart.vertical);

  super.onAttach(chart);
  _chart.addView(this);
}