onPaint method

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

Draws segment in series bounds.

Implementation

@override
void onPaint(Canvas canvas) {
  _setSegmentProperties();
  final HistogramSeries<dynamic, dynamic> histogramSeries =
      _segmentProperties.series as HistogramSeries<dynamic, dynamic>;

  if (_segmentProperties.trackerFillPaint != null &&
      histogramSeries.isTrackVisible) {
    _drawSegmentRect(_segmentProperties.trackerFillPaint!, canvas,
        _segmentProperties.trackRect);
  }

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

  if (fillPaint != null) {
    _drawSegmentRect(fillPaint!, canvas, segmentRect);
  }
  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(strokePaint!, canvas, segmentRect);
  }
}