onPaint method

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

Draws segment in series bounds.

Implementation

@override
void onPaint(Canvas canvas) {
  final SegmentProperties segmentProperties =
      SegmentHelper.getSegmentProperties(this);
  segmentProperties.pathRect = segmentProperties.path.getBounds();
  canvas.drawPath(
      segmentProperties.path,
      (segmentProperties.series.gradient == null)
          ? fillPaint!
          : getFillPaint());

  if (strokePaint!.color != Colors.transparent) {
    drawDashedLine(canvas, segmentProperties.series.dashArray, strokePaint!,
        segmentProperties.strokePath!);
  }
}