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();
  _startControlHighPoints.clear();
  _endControlHighPoints.clear();
  _startControlLowPoints.clear();
  _endControlLowPoints.clear();

  _fillPath.reset();
  _strokePath.reset();
  if (_xValues.isEmpty || _highValues.isEmpty || _lowValues.isEmpty) {
    return;
  }

  _calculatePoints();
  final List<Offset> lerpHighPoints =
      _lerpPoints(_oldHighPoints, _highPoints);
  final List<Offset> lerpLowPoints = _lerpPoints(_oldLowPoints, _lowPoints);
  final List<Offset> lerpStartControlHighPoints =
      _lerpPoints(_oldStartControlHighPoints, _startControlHighPoints);
  final List<Offset> lerpEndControlHighPoints =
      _lerpPoints(_oldEndControlHighPoints, _endControlHighPoints);
  final List<Offset> lerpStartControlLowPoints =
      _lerpPoints(_oldStartControlLowPoints, _startControlLowPoints);
  final List<Offset> lerpEndControlLowPoints =
      _lerpPoints(_oldEndControlLowPoints, _endControlLowPoints);
  _createFillPath(
    _fillPath,
    lerpHighPoints,
    lerpLowPoints,
    lerpStartControlHighPoints,
    lerpEndControlHighPoints,
    lerpStartControlLowPoints,
    lerpEndControlLowPoints,
  );

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