trackballInfo method

  1. @override
TrackballInfo? trackballInfo(
  1. Offset position
)
override

Implementation

@override
TrackballInfo? trackballInfo(Offset position) {
  final int nearestPointIndex = _findNearestPoint(points, position);
  if (nearestPointIndex != -1) {
    final Offset position = points[nearestPointIndex];
    if (position.isNaN) {
      return null;
    }

    final int actualPointIndex = _drawIndexes[nearestPointIndex];
    final CartesianChartPoint<D> chartPoint = _chartPoint(actualPointIndex);
    return ChartTrackballInfo<T, D>(
      position: points[nearestPointIndex],
      point: chartPoint,
      series: series,
      pointIndex: actualPointIndex,
      seriesIndex: series.index,
    );
  }
  return null;
}