decorate method

  1. @override
void decorate(
  1. ArcRendererElementList<D> arcElements,
  2. ChartCanvas canvas,
  3. GraphicsFactory graphicsFactory, {
  4. required Rectangle<num> drawBounds,
  5. required double animationPercent,
  6. bool rtl = false,
})
override

Implementation

@override
void decorate(ArcRendererElementList<D> arcElements, ChartCanvas canvas,
    GraphicsFactory graphicsFactory,
    {required Rectangle drawBounds,
    required double animationPercent,
    bool rtl = false}) {
  /// TODO: Improve label handling for sunburst chart. When a
  /// more sophisticated collision detection is in place, we can draw the
  /// label for inner arc outside when it doesn't collide with outer arcs.

  // Do not draw label for arcs on the inner ring if positioned outside.
  if (innerRingArcLabelPosition == ArcLabelPosition.outside) {
    arcElements.arcs
        .retainWhere((e) => (e as SunburstArcRendererElement).isLeaf == true);
  }
  super.decorate(arcElements, canvas, graphicsFactory,
      drawBounds: drawBounds, animationPercent: animationPercent, rtl: rtl);
}