getDataSetByTouchPoint method

IBarLineScatterCandleBubbleDataSet<Entry>? getDataSetByTouchPoint(
  1. double x,
  2. double y
)

returns the DataSet object displayed at the touched position of the chart

@param x @param y @return

Implementation

IBarLineScatterCandleBubbleDataSet? getDataSetByTouchPoint(
    double x, double y) {
  Highlight? h = getHighlightByTouchPoint(x, y);
  if (h != null) {
    return getData()!.getDataSetByIndex(h.dataSetIndex ?? 0);
  }
  return null;
}