calculateSegmentPoints method

  1. @override
void calculateSegmentPoints()
override

Calculates the rendering bounds of a segment.

Implementation

@override
void calculateSegmentPoints() {
  _setSegmentProperties();

  final SegmentProperties bubbleSegmentProperties = _segmentProperties;
  final SeriesRendererDetails seriesRendererDetails =
      SeriesHelper.getSeriesRendererDetails(
          bubbleSegmentProperties.seriesRenderer);
  _centerX = _centerY = double.nan;
  final Rect rect = calculatePlotOffset(
      seriesRendererDetails.stateProperties.chartAxis.axisClipRect,
      Offset(seriesRendererDetails.xAxisDetails!.axis.plotOffset,
          seriesRendererDetails.yAxisDetails!.axis.plotOffset));
  final ChartLocation location = calculatePoint(
      bubbleSegmentProperties.currentPoint!.xValue,
      bubbleSegmentProperties.currentPoint!.yValue,
      seriesRendererDetails.xAxisDetails!,
      seriesRendererDetails.yAxisDetails!,
      seriesRendererDetails.stateProperties.requireInvertedAxis,
      bubbleSegmentProperties.series,
      rect);
  _centerX = location.x;
  _centerY = location.y;
  if (bubbleSegmentProperties.seriesRenderer is BubbleSeriesRenderer)
    _radius = calculateBubbleRadius(
        seriesRendererDetails,
        bubbleSegmentProperties.series,
        bubbleSegmentProperties.currentPoint!);
  bubbleSegmentProperties.currentPoint!.region = Rect.fromLTRB(
      location.x - 2 * _radius,
      location.y - 2 * _radius,
      location.x + 2 * _radius,
      location.y + 2 * _radius);
  _size = _radius = bubbleSegmentProperties.currentPoint!.region!.width / 2;
}