[Chartjs]-Chart.js filltext object moved when tooltip is generated because of legend not displaying

6👍

I was facing the same issue and posted an issue on the repository. Here’s the reply:

The reason this is happening is that the tooltip is drawing text using
a different textBaseline. The plugin in your fiddle doesn’t set it so
it will be whatever it last was.

I would change your plugin to have the following

var text = 'test';
var x = view.x;
var y = yScale.bottom;
ctx.textBaseline = 'top';
ctx.textAlign = 'center';
ctx.fillStyle = 'rgba(255, 0, 255, 1)';
ctx.fillText(text, x, y);

I tried it on the Fiddle and it works now!

Leave a comment