segmentPointIndex method
Implementation
@override
int segmentPointIndex(Offset position, ChartSegment segment) {
final int length = segment.points.length;
for (int i = 0; i < length; i++) {
final Rect bounds = Rect.fromCenter(
center: segment.points[i],
width: tooltipPadding,
height: tooltipPadding);
if (bounds.contains(position)) {
return i;
}
}
return -1;
}