0👍
tooltips.mode: 'index'
finds items from different datasets that are at the same index each.
You should use tooltips.mode: 'x'
instead, it returns all items that would intersect based on the x
coordinate of the position only.
options: {
...
tooltips: {
mode: 'x',
intersect: 'true'
}
},
Please also have a look at the this Chart.js samples page, which illustrates the behavior of the different combinations of the options
tooltips.mode
andtooltips.intersect
.
- Chartjs-Chart js how do I only show just the low/high dots on line chart?
- Chartjs-Color by point in ChartJS.Blazor
Source:stackexchange.com