-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[charts] fix y-axis tick label overflow #16846
base: master
Are you sure you want to change the base?
[charts] fix y-axis tick label overflow #16846
Conversation
Deploy preview: https://deploy-preview-16846--material-ui-x.netlify.app/ |
CodSpeed Performance ReportMerging #16846 will not alter performanceComparing Summary
|
@alexfauquette @JCQuintas should we consider once again updating the default axis size? Now for the y-axis 😛 The default axis size of 30px isn't enough to render "1,000" without ellipsis: To do so, we'd need a width of 42px: Should we increase the axis size? Would it make sense to reduce the margin or should we keep it as is? 🤔 |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
e7fa935
to
1819759
Compare
ce38fac
to
5ef090b
Compare
5ef090b
to
9898b1c
Compare
68a7125
to
0747a89
Compare
Increased it to 50px and solved the overflows of most demos. Let me know if you think that's acceptable |
That's probably for the better if it makes it so the defaults are better for everyone, I'll take a look at the screenshots |
It seems 40 would fit an entire 4 character number, though I suppose it doesn't because there are some margins expected to exist? |
To fit "1,000" we would need 42px as indicated in this comment. Without the comma, 40px might fit, yeah. Do you prefer if we chose 40px? It seems adding a comma is the default format. |
My brain didn't compute the comma 😅 I believe the best approach would be the lowest size we can have that solves most of the cases we have. Ofc my brain would prefer a round number, but If 42 is the lowest, then we might want to use that instead. |
Ok, but I'd increase a couple pixels to maybe 45px. Text rendering can be different across different OSes, so it's possible that the same font and same text have different sizes. |
Part of #10928.
Depends on:
Fixes tick label overflow for the y-axis. It follows the same approach as #16709, but the y-axis doesn't hide overlapping labels at the moment, which is why in the "after" image below you'll see that there's overlapping labels, namely when the labels are rotated -90 and 90 degrees.
The algorithm for hiding overlapping labels in the y-axis is out of scope for this PR.
Before:
After:
