onPaint method

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

Draws segment in series bounds.

Implementation

@override
void onPaint(Canvas canvas) {
  _setSegmentProperties();
  final BarSeries<dynamic, dynamic> barSeries =
      _segmentProperties.series as BarSeries<dynamic, dynamic>;
  if (_segmentProperties.trackerFillPaint != null &&
      barSeries.isTrackVisible) {
    _drawSegmentRect(canvas, _segmentProperties.trackBarRect,
        _segmentProperties.trackerFillPaint!);
  }

  if (_segmentProperties.trackerStrokePaint != null &&
      barSeries.isTrackVisible) {
    _drawSegmentRect(canvas, _segmentProperties.trackBarRect,
        _segmentProperties.trackerStrokePaint!);
  }

  if (fillPaint != null) {
    _drawSegmentRect(canvas, segmentRect, fillPaint!);
  }
  if (strokePaint != null) {
    final SeriesRendererDetails seriesRendererDetails =
        SeriesHelper.getSeriesRendererDetails(
            _segmentProperties.seriesRenderer);
    (seriesRendererDetails.dashArray![0] != 0 &&
            seriesRendererDetails.dashArray![1] != 0)
        ? drawDashedLine(canvas, seriesRendererDetails.dashArray!,
            strokePaint!, _segmentProperties.path)
        : _drawSegmentRect(canvas, segmentRect, strokePaint!);
  }
}