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();
    final Offset preferredPos =
        Offset(series.pointToPixelX(x, top), series.pointToPixelY(x, top));
    return ChartTrackballInfo<T, D>(
      position: preferredPos,
      highXPos: preferredPos.dx,
      highYPos: preferredPos.dy,
      lowYPos: series.pointToPixelY(chartPoint.xValue!, bottom),
      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;
}