showByIndex method

void showByIndex(
  1. int pointIndex
)

Displays the trackball at the specified point index.

  • pointIndex - index of the point for which the trackball must be shown

Implementation

void showByIndex(int pointIndex) {
  final RenderBehaviorArea? parent = parentBox as RenderBehaviorArea?;
  if (parent != null &&
      parent.plotArea != null &&
      parent.plotArea!.firstChild != null) {
    final CartesianSeriesRenderer renderer =
        parent.plotArea!.firstChild! as CartesianSeriesRenderer;
    final List<num> visibleIndexes = renderer.visibleIndexes;
    if (visibleIndexes.isNotEmpty &&
        visibleIndexes.first <= pointIndex &&
        pointIndex <= visibleIndexes.last) {
      show(renderer.xRawValues[pointIndex], 0);
    }
  }
}