Skip to content
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

Closed
wants to merge 1 commit into from
Closed

This fix tooltip text align #2331

wants to merge 1 commit into from

Conversation

mnsrv
Copy link
Contributor

@mnsrv mnsrv commented Apr 22, 2016

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.

This solves #1977

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.
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 71.645% when pulling 6728d33 on sashamjolnir:patch-1 into b50c281 on nnnick:v2.0-dev.

@etimberg
Copy link
Member

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.

@mnsrv
Copy link
Contributor Author

mnsrv commented Apr 22, 2016

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)

@etimberg
Copy link
Member

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.

@mnsrv
Copy link
Contributor Author

mnsrv commented Apr 22, 2016

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?

@etimberg
Copy link
Member

@panzarino
Copy link
Contributor

Was this issue resolved in #2416?

@mnsrv
Copy link
Contributor Author

mnsrv commented May 9, 2016

@zachpanz88 no.
What I want is to align text inside tooltip. Because tooltip option bodyAlign: 'center', or titleAlign: 'center', is working not as I expect. See MDN Canvas

Examples

titleAlign: left;
bodyAlign: left
left left

titleAlign: left;
bodyAlign: center
left center

titleAlign: center;
bodyAlign: left
center left

titleAlign: center;
bodyAlign: center
center center

Thank you for responses and this great library.

@panzarino
Copy link
Contributor

Closing because out of date

@panzarino panzarino closed this Jun 30, 2016
@mnsrv
Copy link
Contributor Author

mnsrv commented Jun 30, 2016

so this bug #1977 is still unresolved.

@panzarino
Copy link
Contributor

We could be open to accepting a PR if it was based off of the current code in the master branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants