trackballInfo method
TrackballInfo?
trackballInfo(
- Offset position
)
override
Implementation
@override
TrackballInfo? trackballInfo(Offset position) {
final int nearestPointIndex = _findNearestPoint(points, position);
if (nearestPointIndex != -1) {
final int segmentIndex = nearestPointIndex == 0
? currentSegmentIndex
: currentSegmentIndex + 1;
final int pointIndex = clampInt(segmentIndex, 0, series.dataCount - 1);
final CartesianChartPoint<D> chartPoint = _chartPoint(pointIndex);
return ChartTrackballInfo<T, D>(
position: points[nearestPointIndex],
point: chartPoint,
series: series,
pointIndex: pointIndex,
seriesIndex: series.index,
);
}
return null;
}