-
Hello, everyone. I followed the instructions for making a horizontal bar chart, then different instructions (YT video) on how to overlay one bar on top of another (see pic.) The issue is that if the cursor is within any bar, then what appears in the tooltip depends not on what bar is being hovered over, but whether the cursor is in the left half or right half of the bars area. Weird. Here is my code:
Any thoughts on why this is happening are appreciated. Also, there is one vertical and one horizontal light grey line to the left and below the chart. Using 'grid' display: false didn't remove them. V/r, |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
For hovering you can use tooltip mode index (this topic needs a video).
https://www.chartjs.org/docs/3.8.0/samples/tooltip/interactions.html For scale borders are still showing. Gridlines removes only the lines excluding the x and y scale lines.
|
Beta Was this translation helpful? Give feedback.
-
I fixed it. Didn't know what I was doing, but played around with it, and now it works as expected. I added interaction to the options. Here's all the relevant code.
Thank you, Udemology and kurkle, for your help. V/r, CFDev22 |
Beta Was this translation helpful? Give feedback.
-
this worked for me interaction: {
axis: 'y',
}, |
Beta Was this translation helpful? Give feedback.
I fixed it. Didn't know what I was doing, but played around with it, and now it works as expected.
I added interaction to the options. Here's all the relevant code.