transformValues method

  1. @override
void transformValues()
override

Transforms the x and y values to screen coordinates.

Implementation

@override
void transformValues() {
  if (xValue.isNaN || yValue.isNaN || width.isNaN || height.isNaN) {
    segmentRect = null;
    _oldSegmentRect = null;
    points.clear();
    return;
  }

  points.clear();
  final double pixelX = series.pointToPixelX(xValue, yValue);
  final double pixelY = series.pointToPixelY(xValue, yValue);
  final Offset center = Offset(pixelX, pixelY);
  segmentRect = Rect.fromCenter(center: center, width: width, height: height);
  _oldSegmentRect ??= Rect.fromCircle(center: center, radius: 0.0);
}