onPaint method

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

Draws segment in series bounds.

Implementation

@override
void onPaint(Canvas canvas) {
  final RangeColumnSeries<dynamic, dynamic> _series =
      this._series as RangeColumnSeries<dynamic, dynamic>;

  if (_trackerFillPaint != null && _series.isTrackVisible) {
    canvas.drawRRect(_trackRect, _trackerFillPaint!);
  }

  if (_trackerStrokePaint != null && _series.isTrackVisible) {
    canvas.drawRRect(_trackRect, _trackerStrokePaint!);
  }

  if (fillPaint != null) {
    (_series.animationDuration > 0 &&
            !_seriesRenderer._chartState!._isLegendToggled)
        ? _animateRangeColumn(
            canvas,
            _seriesRenderer,
            fillPaint!,
            segmentRect,
            _oldPoint != null ? _oldPoint!.region : _oldRegion,
            animationFactor)
        : canvas.drawRRect(segmentRect, fillPaint!);
  }
  if (strokePaint != null) {
    if (_series.dashArray[0] != 0 && _series.dashArray[1] != 0) {
      _drawDashedLine(canvas, _series.dashArray, strokePaint!, _path);
    } else {
      (_series.animationDuration > 0 &&
              !_seriesRenderer._chartState!._isLegendToggled)
          ? _animateRangeColumn(
              canvas,
              _seriesRenderer,
              strokePaint!,
              segmentRect,
              _oldPoint != null ? _oldPoint!.region : _oldRegion,
              animationFactor)
          : canvas.drawRRect(segmentRect, strokePaint!);
    }
  }
}