Stacked bar chart tooltip not accurate #10939
Unanswered
cosmin-pascu
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
I have a bar chart which contains multiple stacked data on the x axis. The problem is that the tooltip is not accurate (see picture). The reason this happens is that when the interaction is done it looks for the center of the bar (I tried different modes and axes combinations but no one is ok for what I want). What I want is to get the data on which the mouse is hovered (even though they are overlayed). In my example the mouse is on the last column at y=12 and the tooltip appears for the blue one and I want to display the tooltip for the gray area (as my mouse is over the gray area). Is that possible?
I tried creating a custom tooltip: https://www.chartjs.org/docs/latest/configuration/interactions.html#custom-interaction-modes. But it doesn't seem to work, the tooltip doesn't appear anymore. I am using ng2-charts as I have an angular project. I also registered the new mode. I copied the function from the documentation and I have no errors,
Is there any way I can accomplish this behaviour? Or does anybody has any idea why the custom interaction doesn't work?
Beta Was this translation helpful? Give feedback.
All reactions