calculateSegmentPoints method

  1. @override
void calculateSegmentPoints()
override

Calculates the rendering bounds of a segment.

Implementation

@override
void calculateSegmentPoints() {
  final Rect rect = _calculatePlotOffset(
      _seriesRenderer._chartState!._chartAxis._axisClipRect,
      Offset(_seriesRenderer._xAxisRenderer!._axis.plotOffset,
          _seriesRenderer._yAxisRenderer!._axis.plotOffset));
  final _ChartLocation currentChartPoint = _calculatePoint(
      _currentPoint!.xValue,
      _currentCummulativePos,
      _seriesRenderer._xAxisRenderer!,
      _seriesRenderer._yAxisRenderer!,
      _seriesRenderer._chartState!._requireInvertedAxis,
      _series,
      rect);
  final _ChartLocation _nextLocation = _calculatePoint(
      _nextPoint!.xValue,
      _nextCummulativePos,
      _seriesRenderer._xAxisRenderer!,
      _seriesRenderer._yAxisRenderer!,
      _seriesRenderer._chartState!._requireInvertedAxis,
      _series,
      rect);

  final _ChartLocation currentCummulativePoint = _calculatePoint(
      _currentPoint!.xValue,
      _currentCummulativePos,
      _seriesRenderer._xAxisRenderer!,
      _seriesRenderer._yAxisRenderer!,
      _seriesRenderer._chartState!._requireInvertedAxis,
      _series,
      rect);

  final _ChartLocation nextCummulativePoint = _calculatePoint(
      _nextPoint!.xValue,
      _nextCummulativePos,
      _seriesRenderer._xAxisRenderer!,
      _seriesRenderer._yAxisRenderer!,
      _seriesRenderer._chartState!._requireInvertedAxis,
      _series,
      rect);

  _x1 = currentChartPoint.x;
  _y1 = currentChartPoint.y;
  _x2 = _nextLocation.x;
  _y2 = _nextLocation.y;
  _currentCummulativeValue = currentCummulativePoint.y;
  _nextCummulativeValue = nextCummulativePoint.y;
}