-
Notifications
You must be signed in to change notification settings - Fork 11.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tooltip looks incorrect on stacked bar chart with sparse times #9468
Comments
Setting a different tooltip mode resolves your issue: https://jsfiddle.net/Leelenaleee/8oLgvu41/1/ |
Oh perfect, thanks - I hadn't seen that option. So is the default behaviour correct? (i.e., this isn't a bug?) |
(btw, I tried mode: 'point', and that seems much closer to what I'm after - thanks again.) |
No the behaviour itself is not a bug since its taking the index in the data array so even though its linked to a different label its at the same index in the data array. |
OK cool, thanks. |
@FlukeFan read over the part that first label is not showing, this does seem like a bug so you might want to reopen this issue again or create a new one so its a bit more clear since in the samples it also seems like the first label is missing: https://www.chartjs.org/docs/master/samples/scales/time-max-span.html |
@LeeLenaleee thanks - I've opened it as a new issue: #9470 |
|
Because mode index takes the value at the index in the data array so it does not look at the the specific mapping you give in the object notation. If you use mode |
@LeeLenaleee actually, you are right, |
Expected Behavior
Attempting to stack values on a bar chart, where the data x value has sparse time values.
The chart draws correctly I think, but the tooltip is not correct when hovering the mouse over the chart.
The data for 1st May should total 30 (10 + 20);
The data for 2nd May should total 50 (20 + 30);
The data for 5th May should total 40 (10 + 30).
The tooltip should show the combined stacked values when hovered over.
Current Behavior
The tooltip is showing incorrect values when hovering over a stacked-bar:
(The x-axis labels also look a little suspect, it's missing the first label - so I'm curious if I'm doing something wrong here?):
Steps to Reproduce
got to: https://jsfiddle.net/ajgqkvcf/1/
Hover over the first (or any) stacked bar, and the tooltip looks incorrect.
Environment
The text was updated successfully, but these errors were encountered: