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

fix(axis): limit chart dimensions to avoid axis labels overflow #314

Merged
merged 2 commits into from
Aug 16, 2019

Conversation

markov00
Copy link
Member

@markov00 markov00 commented Aug 15, 2019

Summary

This PR limit the chart dimensions to include any overflowing axis label. It consider label padding, font size, text etc.

from:
Screenshot 2019-08-15 at 02 18 37
Screenshot 2019-08-15 at 02 23 58

to:
Screenshot 2019-08-15 at 02 18 50
Screenshot 2019-08-15 at 02 23 38

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

  • Any consumer-facing exports were added to src/index.ts (and stories only import from ../src except for test data & storybook)
  • This was checked for cross-browser compatibility, including a check against IE11
  • Proper documentation or storybook story was added for features that require explanation or tutorials
  • Unit tests were updated or added to match the most common scenarios
  • Each commit follows the convention

@codecov-io
Copy link

codecov-io commented Aug 15, 2019

Codecov Report

Merging #314 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #314      +/-   ##
==========================================
+ Coverage   98.04%   98.04%   +<.01%     
==========================================
  Files          37       37              
  Lines        2714     2715       +1     
  Branches      642      620      -22     
==========================================
+ Hits         2661     2662       +1     
  Misses         48       48              
  Partials        5        5
Impacted Files Coverage Δ
src/chart_types/xy_chart/store/chart_state.ts 96.88% <100%> (ø) ⬆️
src/chart_types/xy_chart/utils/dimensions.ts 80% <100%> (-0.65%) ⬇️
src/chart_types/xy_chart/utils/axis_utils.ts 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e64ddd2...4b0a54a. Read the comment docs.

Copy link
Collaborator

@nickofthyme nickofthyme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally, LGTM! 🚢

@markov00 markov00 merged commit 5751ce0 into elastic:master Aug 16, 2019
@markov00 markov00 deleted the fix_overflow_axis_labels branch August 16, 2019 06:23
markov00 pushed a commit that referenced this pull request Aug 16, 2019
## [9.1.1](v9.1.0...v9.1.1) (2019-08-16)

### Bug Fixes

* **axis:** limit chart dimensions to avoid axis labels overflow ([#314](#314)) ([5751ce0](5751ce0))
@markov00
Copy link
Member Author

🎉 This PR is included in version 9.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@markov00 markov00 added the released Issue released publicly label Aug 16, 2019
@markov00 markov00 mentioned this pull request Aug 16, 2019
25 tasks
AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this pull request Feb 10, 2022
## [9.1.1](elastic/elastic-charts@v9.1.0...v9.1.1) (2019-08-16)

### Bug Fixes

* **axis:** limit chart dimensions to avoid axis labels overflow ([opensearch-project#314](elastic/elastic-charts#314)) ([010634d](elastic/elastic-charts@010634d))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Issue released publicly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants