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(legend): no truncation with single value #1316

Merged
merged 4 commits into from
Aug 19, 2021

Conversation

nickofthyme
Copy link
Collaborator

@nickofthyme nickofthyme commented Aug 19, 2021

Summary

Fix issue with single item legends limiting width of legend.

Screen Recording 2021-08-19 at 10 04 33 AM

Details

The legend grid styles logic attempts to create the best fit for all cases. This is not always the case as the limiting size may not be ideal for (a) the number of series and/or (b) the width of the chart, leading to unnecessary white space. This option is configurable via the verticalWidth theme parameter however in the case of a single value the legend can always be set to the full width.

Issues

fixes #1312

Checklist

  • The proper chart type label was added (e.g. :xy, :partition) if the PR involves a specific chart type
  • The proper feature label was added (e.g. :interactions, :axis) if the PR involves a specific chart feature
  • Proper documentation or storybook story was added for features that require explanation or tutorials

@nickofthyme nickofthyme added :legend Legend related issue :all Applies to all chart types labels Aug 19, 2021
@nickofthyme nickofthyme requested a review from markov00 August 19, 2021 15:20
Copy link
Member

@markov00 markov00 left a comment

Choose a reason for hiding this comment

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

Code looks good to me.
The legend needs to be anyway redesigned to accommodate more edge cases, but this solves the linked issue

@nickofthyme
Copy link
Collaborator Author

Code looks good to me.
The legend needs to be anyway redesigned to accommodate more edge cases, but this solves the linked issue

Yup I added the issue to #580

@nickofthyme nickofthyme merged commit 7ec8a9f into elastic:master Aug 19, 2021
@nickofthyme nickofthyme deleted the fix-single-legend-wrapping branch August 19, 2021 18:37
nickofthyme pushed a commit that referenced this pull request Aug 19, 2021
# [34.1.0](v34.0.0...v34.1.0) (2021-08-19)

### Bug Fixes

* **goal:** tooltip actual color ([#1302](#1302)) ([dbe9d36](dbe9d36))
* **heatmap:** improve legend item ([#1317](#1317)) ([49c35ce](49c35ce))
* **legend:** no truncation with single value ([#1316](#1316)) ([7ec8a9f](7ec8a9f))

### Features

* **goal:** optional target tick ([#1301](#1301)) ([88adf22](88adf22))
@nickofthyme
Copy link
Collaborator Author

🎉 This PR is included in version 34.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@nickofthyme nickofthyme added the released Issue released publicly label Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:all Applies to all chart types :legend Legend related issue released Issue released publicly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[legend] top and bottom legend position doesn't work well with new truncate setting
2 participants