dataLabelPosition method

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

Implementation

@override
Offset dataLabelPosition(CircularDataLabelBoxParentData current, Size size) {
  final DoughnutSegment<T, D> segment =
      segments[current.dataPointIndex] as DoughnutSegment<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 = segment._innerRadius
    ..outerRadius = segment._outerRadius
    ..center = center
    ..fill = palette[current.dataPointIndex % palette.length];

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