paint method

  1. @override
void paint(
  1. ChartCanvas canvas,
  2. double animationPercent
)
override

Draw this component on the canvas.

Implementation

@override
void paint(ChartCanvas canvas, double animationPercent) {
  if (animationPercent == 1.0) {
    _axisTicks.removeWhere((t) => t.markedForRemoval);
  }

  for (var i = 0; i < _axisTicks.length; i++) {
    final animatedTick = _axisTicks[i];
    tickDrawStrategy!.draw(
        canvas, animatedTick..setCurrentTick(animationPercent),
        orientation: axisOrientation!,
        axisBounds: _componentBounds!,
        collision: hasTickCollision,
        drawAreaBounds: _drawAreaBounds!,
        isFirst: i == 0,
        isLast: i == _axisTicks.length - 1);
  }

  if (drawAxisLine) {
    tickDrawStrategy!
        .drawAxisLine(canvas, axisOrientation!, _componentBounds!);
  }
}