paint method
void
paint(
- ChartCanvas canvas,
- Point<
double> p1, - double radius, {
- required Point<
double> p2, - Color? fillColor,
- Color? strokeColor,
- double? strokeWidthPx,
override
Implementation
@override
void paint(ChartCanvas canvas, Point<double> p1, double radius,
{required Point<double> p2,
Color? fillColor,
Color? strokeColor,
double? strokeWidthPx}) {
if (p1 == null) {
throw ArgumentError('Invalid point p1 "${p1}"');
}
if (p2 == null) {
throw ArgumentError('Invalid point p2 "${p2}"');
}
final adjustedP1 = Point<double>(p1.x, p1.y);
final adjustedP2 = Point<double>(p2.x, p2.y);
canvas.drawLine(
points: [adjustedP1, adjustedP2],
stroke: strokeColor,
roundEndCaps: true,
strokeWidthPx: radius * 2);
}