[Chartjs]-Chart.js Show label/tooltip for single point when multiple points coincide

0👍

Use the afterBody callback to manually adjust what the tooltip is going to show by removing all but the one point that you want to show. https://www.chartjs.org/docs/latest/configuration/tooltip.html#tooltip-callbacks

0👍

You can filter tooltips using knowledge about the entire dataset

// ChartJs version: 3.7.1

tooltip: {
  filter: (item, index, list) => (
    item.parsed.x !== list[0].parsed.x &&
    item.parsed.y !== list[0].parsed.y) ||
    index === 0
  )
}

// ...

Screenshot

Leave a comment