Chartjs-Tooltip messes up bar chart in Chart.js

3👍

This is because you are not restoring the canvas state after rotating it. Instead of restoring it inside the if statement, you should restore it outside, like so :

...
if (bar._datasetIndex == 0) {
   ctx.fillText(bar._model.label, 0, 0);
}
ctx.restore(); //<- restore canvas state
...

also, you should better create a plugin (to prevent label flickering), instead of drawing the labels on animation complete.

Here is the working example on JSFiddle

Leave a comment