transformValues method

  1. @override
void transformValues()
override

Transforms the x and y values to screen coordinates.

Implementation

@override
void transformValues() {
  points.clear();
  _drawIndexes.clear();
  _highPoints.clear();
  _lowPoints.clear();
  if (_xValues.isEmpty || _lowValues.isEmpty || _highValues.isEmpty) {
    return;
  }

  _fillPath.reset();
  _strokePath.reset();

  _calculatePoints(_xValues, _highValues, _lowValues);
  final List<Offset> lerpHighPoints =
      _lerpPoints(_oldHighPoints, _highPoints);
  final List<Offset> lerpLowPoints = _lerpPoints(_oldLowPoints, _lowPoints);
  _createFillPath(_fillPath, lerpHighPoints, lerpLowPoints);

  switch (series.borderDrawMode) {
    case RangeAreaBorderMode.all:
      _strokePath = _fillPath;
      break;
    case RangeAreaBorderMode.excludeSides:
      _createStrokePathForExcludeSides(
          _strokePath, lerpHighPoints, lerpLowPoints);
      break;
  }
}