drawDataLabel method
void
drawDataLabel(])
Implementation
void drawDataLabel(
Canvas canvas, String text, Offset point, TextStyle style, int angle,
[bool? isRtl]) {
final int maxLines = getMaxLinesContent(text);
final TextSpan span = TextSpan(text: text, style: style);
final TextPainter tp = TextPainter(
text: span,
textDirection: (isRtl ?? false) ? TextDirection.rtl : TextDirection.ltr,
textAlign: TextAlign.center,
maxLines: maxLines);
tp.layout();
canvas.save();
canvas.translate(point.dx + tp.width / 2, point.dy + tp.height / 2);
Offset labelOffset = Offset.zero;
canvas.rotate(degreeToRadian(angle));
labelOffset = Offset(-tp.width / 2, -tp.height / 2);
tp.paint(canvas, labelOffset);
canvas.restore();
}