calculateSegmentPoints method

  1. @override
void calculateSegmentPoints()
override

Calculates the rendering bounds of a segment.

Implementation

@override
void calculateSegmentPoints() {
  _setSegmentProperties();
  final SeriesRendererDetails seriesRendererDetails =
      SeriesHelper.getSeriesRendererDetails(
          _segmentProperties.seriesRenderer);
  _xAxisRenderer = seriesRendererDetails.xAxisDetails!;
  _yAxisRenderer = seriesRendererDetails.yAxisDetails!;
  _axisClipRect = calculatePlotOffset(
      _segmentProperties.stateProperties.chartAxis.axisClipRect,
      Offset(seriesRendererDetails.xAxisDetails!.axis.plotOffset,
          seriesRendererDetails.yAxisDetails!.axis.plotOffset));
  _currentPointLocation = calculatePoint(
      _segmentProperties.currentPoint!.xValue,
      _segmentProperties.currentPoint!.yValue,
      _xAxisRenderer,
      _yAxisRenderer,
      _segmentProperties.stateProperties.requireInvertedAxis,
      _segmentProperties.series,
      _axisClipRect);
  _segmentProperties.x1 = _currentPointLocation.x;
  _segmentProperties.y1 = _currentPointLocation.y;
  _nextPointLocation = calculatePoint(
      _segmentProperties.nextPoint!.xValue,
      _segmentProperties.nextPoint!.yValue,
      _xAxisRenderer,
      _yAxisRenderer,
      _segmentProperties.stateProperties.requireInvertedAxis,
      _segmentProperties.series,
      _axisClipRect);
  _segmentProperties.x2 = _nextPointLocation.x;
  _segmentProperties.y2 = _nextPointLocation.y;
}