addSeriesRenderer method

void addSeriesRenderer(
  1. SeriesRenderer<D> renderer
)

Implementation

void addSeriesRenderer(SeriesRenderer<D> renderer) {
  final rendererId = renderer.rendererId;

  final previousRenderer = _seriesRenderers[rendererId];
  if (previousRenderer != null) {
    removeView(previousRenderer);
    previousRenderer.onDetach(this);
  }

  addView(renderer);
  renderer.onAttach(this);
  _seriesRenderers[rendererId] = renderer;
}