Open zamaldev opened 5 months ago
I had the same problem, a possible workaround is set the option:
interaction: {
intersect: true,
mode: "dataset",
},
On the example you provide:
options: {
indexAxis: "y",
interaction: {
intersect: true,
mode: "dataset",
},
maintainAspectRatio: false,
scales: {
x: {
stacked: false,
}
}
}
Expected behavior
Proper tooltip shown on bar is hovered.
Current behavior
Seems like areas for tooltips are shifted when bar chart is stacked. Probably its because of
data.datasets[].stack
property. The bars are stacked, but tooltip areas act like there is nostack
property.Reproducible sample
https://jsfiddle.net/ovagrc80/
Optional extra steps/info to reproduce
Just try to slide cursor over bars, and see which tooltip is shown
Possible solution
No response
Context
I have a statistics, what I need to show as a horizontal bar chart. Basically all I need is in sample, but that bug with tooltip confuse me.
Expected chart:
chart.js version
v4.4.1
Browser name and version
No response
Link to your project
No response