-
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
This fix tooltip text align #2331
Conversation
What do you think about fix behavior of ctx.fillText for align: 'center' or align: 'right' ? It's not working as expected. I tried to solve this problem: change x coordinate depending on the alignment at Title, Body and Footer.
Hmm, I'm not sure about this. I agree that it eliminates the issue, but it also makes the alignment options useless. The alignment options, if i remember correctly, were intended to allow customization of how the tooltip behaved around points. There were (they still might exist) some internal alignment strings and these options were supposed to set those. |
According to documentation, tooltip text alignment options (*Align, *-title,body,footer) are only for text inside tooltip. I think this pull request doesn't changes tooltip position or tooltip behavior. May be we should try to create new options to text alignment inside tooltip, because sometimes sometimes it's necessary and with this option we cannot achieve it (issue pics) |
You're correct that this is meant for the text. The issue I have is that by simply fitting the text no matter the alignment, the alignment options don't do anything because the text will always draw in the same place. My thought was that the text would be shifted by the alignment change, but that the tooltip would follow the text. I think you are right that we need different options though. |
Em, by the way, I didn't found some alignment options, that rules position of tooltip (top, bottom, left or right) relative to point (at line chart). You mean this title, body, footer Alignment option used to use for that? |
I had meant this stuff: https://github.com/nnnick/Chart.js/blob/master/src/core/core.tooltip.js#L339-L396 |
Was this issue resolved in #2416? |
@zachpanz88 no. Examples
Thank you for responses and this great library. |
Closing because out of date |
so this bug #1977 is still unresolved. |
We could be open to accepting a PR if it was based off of the current code in the |
What do you think about fix behavior of ctx.fillText for
align: 'center'
oralign: 'right'
? It's not working as expected.I tried to solve this problem: change x coordinate depending on the alignment at Title, Body and Footer.
This solves #1977