function getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) {
  const items = [];

  if (!includeInvisible && !chart.isPointInArea(position)) {
    return items;
  }

  const evaluationFunc = function(element, datasetIndex, index) {
    if (!includeInvisible && !_isPointInArea(element, chart.chartArea, 0)) {
      return;
    }
    if (element.inRange(position.x, position.y, useFinalPosition)) {
      items.push({element, datasetIndex, index});
    }
  };

  evaluateInteractionItems(chart, axis, position, evaluationFunc, true);
  return items;
}
Helper function to get the items that intersect the event position
@param {Chart} chart - the chart
@param {Point} position - the point to be nearest to, in relative coordinates
@param {string} axis - the axis mode. x|y|xy|r
@param {boolean} [useFinalPosition] - use the element's animation target instead of current position
@param {boolean} [includeInvisible] - include invisible points that are outside of the chart area
@return {InteractionItem[]} the nearest items