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 values) percentage formatter should be distict from tick formatter #2474

Merged
merged 5 commits into from
Jul 1, 2024

Conversation

mbondyra
Copy link
Contributor

@mbondyra mbondyra commented Jun 25, 2024

Summary

Fixes a few small issues for legend values:

  • ✔️ Percent and difference percent formatting should not take the format from tick formatter. Instead, we override it with a percent formatter with a precision 0.1. Fixed, visual test added
  • ✔️ for formatting with MB as a suffix, unnecessary scroll appears. That's because we calculate the width of each cell approximately and we underestimated. I corrected it by changing the width to 8.5 for each letter.
  • ✔️ for the value headers that are longer than the value (for example last non null), unnecessary scroll appear because we didn't apply the proper font width that is bold. Fixed, visual test added

I changed one of the tests to make sure we test at least one stacked chart.

@mbondyra mbondyra added the :legend Legend related issue label Jun 25, 2024
@mbondyra mbondyra changed the title fix: fix % formatter for legend values and letter width to avoid unnecessary scroll fix: (Legend values) percentage formatter Jun 25, 2024
@mbondyra mbondyra force-pushed the fix_legend_stats_issues branch 2 times, most recently from 440bb1b to e405c71 Compare June 26, 2024 11:05
@mbondyra mbondyra changed the title fix: (Legend values) percentage formatter fix: (Legend values) percentage formatter should be distict from tick formatter Jun 26, 2024
@mbondyra mbondyra force-pushed the fix_legend_stats_issues branch 4 times, most recently from 245db6f to 2b3dd1e Compare June 27, 2024 14:12
@mbondyra mbondyra force-pushed the fix_legend_stats_issues branch from 2b3dd1e to b02a4dd Compare June 27, 2024 14:14
@mbondyra mbondyra force-pushed the fix_legend_stats_issues branch from 75f9b69 to d83cf67 Compare June 27, 2024 14:53
@mbondyra
Copy link
Contributor Author

buildkite update screenshots

@elastic elastic deleted a comment from elastic-datavis bot Jun 27, 2024
@mbondyra mbondyra marked this pull request as ready for review June 27, 2024 15:21
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.

Change look good!

It kinda feels to me that we are in need of a some type of separate legendValueFormatter instead of just relying on the tickFormat for everything. This way we could let the user handle the percent and null cases directly.

Similar to how we have a labelFormat option just to format the axis label values apart from the tooltip values, see demo here.

No changes required, just commenting for future discussion.

@mbondyra
Copy link
Contributor Author

mbondyra commented Jul 1, 2024

I am gonna go ahead and merge it so I can start working on upgrading it in Kibana

@mbondyra mbondyra merged commit b5bd998 into elastic:main Jul 1, 2024
14 checks passed
nickofthyme pushed a commit that referenced this pull request Jul 1, 2024
## [66.0.5](v66.0.4...v66.0.5) (2024-07-01)

### Bug Fixes

* (Legend values) percentage formatter should be distict from tick formatter ([#2474](#2474)) ([b5bd998](b5bd998))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:legend Legend related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants