paint method

  1. @override
void paint(
  1. ChartCanvas canvas,
  2. Point<double> p1,
  3. double radius, {
  4. required Point<double> p2,
  5. Color? fillColor,
  6. Color? strokeColor,
  7. double? strokeWidthPx,
})
override

Implementation

@override
void paint(
  ChartCanvas canvas,
  Point<double> p1,
  double radius, {
  required Point<double> p2,
  Color? fillColor,
  Color? strokeColor,
  double? strokeWidthPx,
}) {
  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,
  );
}