onPaint method
Draws segment in series bounds.
Implementation
@override
void onPaint(Canvas canvas) {
if (segmentRect == null) {
return;
}
final Rect? paintRect =
Rect.lerp(_oldSegmentRect, segmentRect, animationFactor);
if (paintRect == null || paintRect.isEmpty) {
return;
}
Paint paint = getFillPaint();
if (paint.color != Colors.transparent) {
canvas.drawOval(paintRect, paint);
}
paint = getStrokePaint();
final double strokeWidth = paint.strokeWidth;
if (paint.color != Colors.transparent && strokeWidth > 0) {
final Path strokePath = Path()
..addOval(paintRect.deflate(strokeWidth / 2));
drawDashes(canvas, series.dashArray, paint, path: strokePath);
}
}