index(chart, e, options, useFinalPosition) {
      const position = getRelativePosition(e, chart);
      // Default axis for index mode is 'x' to match old behaviour
      const axis = options.axis || 'x';
      const includeInvisible = options.includeInvisible || false;
      const items = options.intersect
        ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible)
        : getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);
      const elements = [];

      if (!items.length) {
        return [];
      }

      chart.getSortedVisibleDatasetMetas().forEach((meta) => {
        const index = items[0].index;
        const element = meta.data[index];

        // don't count items that are skipped (null data)
        if (element && !element.skip) {
          elements.push({element, datasetIndex: meta.index, index});
        }
      });

      return elements;
    }
Returns items at the same index. If the options.intersect parameter is true, we only return items if we intersect something
If the options.intersect mode is false, we find the nearest item and return the items at the same index as that item
@function Chart.Interaction.modes.index
@since v2.4.0
@param {Chart} chart - the chart we are returning items from
@param {Event} e - the event we are find things at
@param {InteractionOptions} options - options to use
@param {boolean} [useFinalPosition] - use final element position (animation target)
@return {InteractionItem[]} - items that are found