highlightValue6 method

void highlightValue6(
  1. Highlight? high,
  2. bool callListener
)

Highlights the value selected by touch gesture. Unlike highlightValues(...), this generates a callback to the OnChartValueSelectedListener.

@param high - the highlight object @param callListener - call the listener

Implementation

void highlightValue6(Highlight? high, bool callListener) {
  Entry? e;

  if (high == null) {
    _indicesToHighlight = null;
  } else {
    e = _data!.getEntryForHighlight(high);
    if (e == null) {
      _indicesToHighlight = null;
      high = null;
    } else {
      // set the indices to highlight
      _indicesToHighlight = List.empty(growable: true)..add(high);
    }
  }

  if (callListener && _selectionListener != null) {
    if (!valuesToHighlight()) {
      _selectionListener?.onNothingSelected();
    } else {
      // notify the listener
      _selectionListener?.onValueSelected(e, high);
    }
  }
}