Chart.js icon indicating copy to clipboard operation
Chart.js copied to clipboard

Tooltip text is misaligned

Open IonutLaceanu opened this issue 10 years ago • 9 comments

In v2, when I change the alignment of tooltip's title or body, the text goes out of the tooltip on the left side.

right align: screenshot 2016-02-04 11 08 47

center align: screenshot 2016-02-04 11 09 13

IonutLaceanu avatar Feb 04 '16 09:02 IonutLaceanu

This happens because CanvasRendering.

I tried to solve this problem with changing x coordinate off ctx.fillText if align is center or right.

mnsrv avatar Apr 22 '16 19:04 mnsrv

Any update on this? I'm seeing this issue as well.

lakenen avatar May 26 '16 20:05 lakenen

Confirmed this is fixed after #3446 was merged when using the xAlign and yAlign tooltip options.

etimberg avatar Oct 16 '16 14:10 etimberg

Unfortunately, the issue is still present in 2.5.0: http://codepen.io/anon/pen/RpwppR

zlorf avatar Feb 23 '17 16:02 zlorf

As of 2.7.1 the alignment of the tooltip text is still off. titleAlign, bodyAlign and footerAlign use the x edge of the tooltip model as a base for the text alignment.

nelsonkoehn avatar Nov 09 '17 00:11 nelsonkoehn

Should this issue be reopened since it is still a bug, or is there a new issue for this?

tilds avatar Oct 17 '18 09:10 tilds

Is there a work-around for this bug? I tried to look for a property to add padding to the text of the tooltip but couldn't find anything.

Rodigee avatar Nov 09 '18 18:11 Rodigee

I'm having this issue in 2.7.2 and cannot get text alignment with any combination of bodyAlign and xAlign.

elarbee avatar Nov 14 '18 15:11 elarbee

Would like to know when this problem will be resolved.

Bloodcast69 avatar Dec 19 '18 06:12 Bloodcast69