onDraw method

  1. @override
void onDraw(
  1. Canvas canvas
)
override

Draws the x axis labels, the web, the limit lines behind the data, the data, the highlights, the limit lines in front of the data, the y axis labels, the values, the legend, the description and the markers, in that order, or the empty state while there is nothing to draw.

Implementation

@override
void onDraw(ui.Canvas canvas) {
  super.onDraw(canvas);

  if (showsEmptyState) return;

  if (xAxis.isEnabled) {
    xAxisRenderer.computeAxis(xAxis.axisMinimum, xAxis.axisMaximum, false);
  }

  xAxisRenderer.renderAxisLabels(canvas);

  if (isDrawWebEnabled) renderer.drawExtras(canvas);

  if (yAxis.isEnabled && yAxis.isDrawLimitLinesBehindDataEnabled) {
    yAxisRenderer.renderLimitLines(canvas);
  }

  renderer.drawData(canvas);

  final highlighted = this.highlighted;
  if (valuesToHighlight()) renderer.drawHighlighted(canvas, highlighted);

  if (yAxis.isEnabled && !yAxis.isDrawLimitLinesBehindDataEnabled) {
    yAxisRenderer.renderLimitLines(canvas);
  }

  yAxisRenderer.renderAxisLabels(canvas);

  renderer.drawValues(canvas);

  legendRenderer.renderLegend(canvas);

  drawDescription(canvas);

  drawMarkers(canvas);

  notifyAfterDraw();
}