drawChartText function
void
drawChartText(})
Draws text anchored at at by h/v. The shared label helper every chart
uses (the equivalent of SwiftUI's context.draw(Text…, at:, anchor:)).
Implementation
void drawChartText(
Canvas canvas,
String text,
Offset at, {
required Color color,
double fontSize = 9,
FontWeight weight = FontWeight.normal,
HAlign h = HAlign.start,
VAlign v = VAlign.top,
}) {
final painter = _layoutLabel(text, color, fontSize, weight);
final dx = ChartText.dx(h, painter.width);
final dy = ChartText.dy(v, painter.height);
painter.paint(canvas, Offset(at.dx + dx, at.dy + dy));
}