trackballInfo method

  1. @override
TrackballInfo? trackballInfo(
  1. Offset position,
  2. int pointIndex
)
override

Implementation

@override
TrackballInfo? trackballInfo(Offset position, int pointIndex) {
  if (pointIndex != -1 && segmentRect != null) {
    final CartesianChartPoint<D> chartPoint = _chartPoint();
    Offset primaryPos;
    if (points.isNotEmpty && points.length == 8) {
      primaryPos = points[3];
    } else {
      primaryPos = Offset(series.pointToPixelX(x, chartPoint.upperQuartile!),
          series.pointToPixelY(x, chartPoint.upperQuartile!));
    }

    return ChartTrackballInfo<T, D>(
      position: primaryPos,
      maxYPos: series.pointToPixelY(x, chartPoint.maximum!),
      point: chartPoint,
      series: series,
      seriesIndex: series.index,
      segmentIndex: currentSegmentIndex,
      pointIndex: pointIndex,
      text: series.trackballText(chartPoint, series.name),
      header: series.tooltipHeaderText(chartPoint),
      color: fillPaint.color,
    );
  }
  return null;
}