dataPointIndex method

  1. @override
int dataPointIndex(
  1. Offset position,
  2. ChartSegment segment
)
override

Implementation

@override
int dataPointIndex(Offset position, ChartSegment segment) {
  final FastLineSegment fastLineSegment = segment as FastLineSegment<T, D>;
  final int nearestPointIndex =
      fastLineSegment._findNearestPoint(fastLineSegment.points, position);
  final int pointIndex = fastLineSegment._drawIndexes[nearestPointIndex];
  if (pointIndex != -1) {
    return super.actualPointIndex(pointIndex);
  }
  return pointIndex;
}