onPaint method

  1. @override
void onPaint(
  1. Canvas canvas
)
override

Draws segment in series bounds.

Implementation

@override
void onPaint(Canvas canvas) {
  if (points.isEmpty) {
    return;
  }

  final Paint paint = getStrokePaint();
  final List<double>? dashedArray = series.dashArray;
  if (paint.color != Colors.transparent && paint.strokeWidth > 0) {
    if (dashedArray != null || series.emptyPointIndexes.isNotEmpty) {
      drawDashesFromPoints(canvas, points, dashedArray, paint);
    } else {
      canvas.drawPoints(PointMode.polygon, points, paint);
    }
  }
}