attachTo method
Injects the behavior into a chart.
Implementation
@override
void attachTo(BaseChart<D> chart) {
if (chart is! CartesianChart<D>) {
throw ArgumentError('Slider can only be attached to a cartesian chart.');
}
_chart = chart;
// Only vertical rendering is supported by this behavior.
assert(chart.vertical);
_view = SliderLayoutView<D>(
layoutPaintOrder: layoutPaintOrder,
handleRenderer: _handleRenderer,
);
chart
..addView(_view)
..addGestureListener(_gestureListener)
..addLifecycleListener(_lifecycleListener);
}