dataLabelPosition method

  1. @override
Offset dataLabelPosition(
  1. CircularDataLabelBoxParentData current,
  2. Size size
)
override

Implementation

@override
Offset dataLabelPosition(CircularDataLabelBoxParentData current, Size size) {
  final PieSegment<T, D> segment =
      segments[current.dataPointIndex] as PieSegment<T, D>;
  current.point!
    ..degree = segment._degree
    ..isExplode = segment._isExploded
    ..isVisible = segment.isVisible
    ..explodeOffset = explodeOffset
    ..startAngle = segment._startAngle
    ..endAngle = segment._endAngle
    ..midAngle = (segment._startAngle + segment._endAngle) / 2
    ..innerRadius = 0.0
    ..outerRadius = segment._outerRadius
    ..center = center
    ..fill = palette[current.dataPointIndex % palette.length];

  _findDataLabelPosition(current.point!);
  return super.dataLabelPosition(current, size);
}