calculateLabelPosition method
ArcLabelPosition
calculateLabelPosition(
- TextElement labelElement,
- TextStyle labelStyle,
- int insideArcWidth,
- int outsideArcWidth,
- ArcRendererElement arcRendererElement,
- ArcLabelPosition labelPosition,
override
Implementation
@override
ArcLabelPosition calculateLabelPosition(
TextElement labelElement,
TextStyle labelStyle,
int insideArcWidth,
int outsideArcWidth,
ArcRendererElement arcRendererElement,
ArcLabelPosition labelPosition) {
assert(arcRendererElement is SunburstArcRendererElement);
if ((arcRendererElement as SunburstArcRendererElement).isOuterMostRing ==
true) {
return super.calculateLabelPosition(
labelElement,
labelStyle,
insideArcWidth,
outsideArcWidth,
arcRendererElement,
outerRingArcLabelPosition);
} else if ((arcRendererElement).isLeaf ==
true) {
return super.calculateLabelPosition(
labelElement,
labelStyle,
insideArcWidth,
outsideArcWidth,
arcRendererElement,
innerRingLeafArcLabelPosition);
} else {
/// 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.
// Force label for arc on the inner ring inside.
return ArcLabelPosition.inside;
}
}