-
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
align text inside chart for far-aligned labels #8269
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How are you constraining the scale size? It should take more room with long labels by default.
Some tests are failing, take a look at those.
c0e8baf
to
ec80df6
Compare
In the screenshot (and the application where we'd want this feature) I'm overwriting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wrong the first time, you should use the full chart size in scale direction, because the margins in the corners are also available for labels.
Added a suggestion, would that work correctly?
I think you should add an fixture test for this feature.
width: 512 | ||
} | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding tolerance: 0.01
might help it pass in both browsers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iamarcel are you able to try this out? Would love to get this merged
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That will fix it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for continuing this while I was out and half forgetting about this! :)
This was merged in #8359 |
When you have long labels on a horizontal chart that get cut off, the end is cut off by default. If I change the alignment to "far", the text alignment is okay but the wrong side of the labels is still shown.
For example, with labels on the left side and crossAlign "far", you'd see the end of the longest labels and white room for shorter labels.
With these changes, the labels would start on the left side so you see the beginning of the labels: