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

[charts] Fix default label measurement being off #16635

Merged

Conversation

bernardobelchior
Copy link
Member

Fix default label measurement being off by a few pixels. This happened because the text style was being applied through a class, but we only take inline styles into account when measuring the labels' size. This PR fixes the issue by applying the text styles as inline styles.

It also adds a caveat in the docs that applying text styles through classes may result in overlaps:

image

Please let me know if this kind of warning content and style is acceptable within the docs.

@mui-bot
Copy link

mui-bot commented Feb 18, 2025

Deploy preview: https://deploy-preview-16635--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against c4ea188

@bernardobelchior bernardobelchior force-pushed the fix-tick-label-measurement branch from 9d0c9c0 to 4cd069d Compare February 18, 2025 09:53
@bernardobelchior bernardobelchior added the component: charts This is the name of the generic UI component, not the React module! label Feb 18, 2025
Copy link

codspeed-hq bot commented Feb 18, 2025

CodSpeed Performance Report

Merging #16635 will not alter performance

Comparing bernardobelchior:fix-tick-label-measurement (c4ea188) with master (c66eb26)

Summary

✅ 6 untouched benchmarks

@bernardobelchior bernardobelchior force-pushed the fix-tick-label-measurement branch from 6c5bd42 to 7c866a9 Compare February 18, 2025 10:54
@bernardobelchior bernardobelchior marked this pull request as ready for review February 18, 2025 11:52
@bernardobelchior bernardobelchior merged commit 2c7a7f1 into mui:master Feb 18, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: charts This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants