drawTrackball function
void
drawTrackball(})
A vertical trackball line at x spanning top..bottom, with optional ring
markers (one per series value at the active column) in markerColors.
Implementation
void drawTrackball(
Canvas canvas, {
required double x,
required double top,
required double bottom,
required Color lineColor,
List<Offset> markers = const [],
List<Color> markerColors = const [],
}) {
canvas.drawLine(
Offset(x, top),
Offset(x, bottom),
Paint()
..color = lineColor
..strokeWidth = 1,
);
for (var i = 0; i < markers.length; i++) {
final c = i < markerColors.length ? markerColors[i] : lineColor;
drawHighlightRing(canvas, markers[i], c, radius: 5);
}
}