function getNearestItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {
  if (!includeInvisible && !chart.isPointInArea(position)) {
    return [];
  }

  return axis === 'r' && !intersect
    ? getNearestRadialItems(chart, position, axis, useFinalPosition)
    : getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible);
}
Helper function to get the items nearest to the event position considering all visible items in the chart
@param {Chart} chart - the chart to look at elements from
@param {Point} position - the point to be nearest to, in relative coordinates
@param {string} axis - the axes along which to measure distance
@param {boolean} [intersect] - if true, only consider items that intersect the position
@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