dataLabelPosition method
Offset
dataLabelPosition(
- ChartElementParentData current,
- ChartDataLabelAlignment alignment,
- Size size
override
Implementation
@override
Offset dataLabelPosition(ChartElementParentData current,
ChartDataLabelAlignment alignment, Size size) {
final num x = current.x! + (sbsInfo.maximum + sbsInfo.minimum) / 2;
final double bottomValue = bottomValues[current.dataPointIndex].toDouble();
double y = current.y!.toDouble();
if (alignment == ChartDataLabelAlignment.bottom) {
y = bottomValue;
} else if (alignment == ChartDataLabelAlignment.middle) {
y = (y + bottomValue) / 2;
}
return _calculateDataLabelPosition(
x, y, alignment, size, current.y!.isNegative);
}