Chart.js: Tooltip text is misaligned

Created on 4 Feb 2016  路  9Comments  路  Source: chartjs/Chart.js

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

bug

All 9 comments

This happens because CanvasRendering.

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

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

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

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

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.

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

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.

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

Would like to know when this problem will be resolved.

Was this page helpful?
0 / 5 - 0 ratings