paint method

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

Renders the series data on the canvas, using the data generated during the update call.

Implementation

@override
void paint(ChartCanvas canvas, double animationPercent) {
  // Clean up the arcs that no longer exist.
  if (animationPercent == 1.0) {
    final keysToRemove = <String>[];

    _seriesArcMap.forEach((String key, AnimatedArcList<D> arcList) {
      arcList.arcs.removeWhere((AnimatedArc<D> arc) => arc.animatingOut);

      if (arcList.arcs.isEmpty) {
        keysToRemove.add(key);
      }
    });

    keysToRemove.forEach(_seriesArcMap.remove);
  }
  super.paint(canvas, animationPercent);
}