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

[xy] Nicely compute the axis label overflow #1490

Open
Tracked by #2320
markov00 opened this issue Nov 19, 2021 · 3 comments
Open
Tracked by #2320

[xy] Nicely compute the axis label overflow #1490

markov00 opened this issue Nov 19, 2021 · 3 comments
Labels
:axis Axis related issue bug Something isn't working Impact:High :Lens Kibana Lens related issue :xy Bar/Line/Area chart related

Comments

@markov00
Copy link
Member

Describe the bug
When showing a categorical vertical bar chart and one label is way longer then all the others the following happen:

  • we compute the axis label overflow (the space to leave blank on the right/left of an horizontal axis) depending on the maximum label size: we actually reduce the chat width by the maximum label size, putting half of that size to the right and half on the left of the chart
  • the previous point happens before computing the visible labels, which could hide some of them due to occlusions.
  • the result is that we will render a smaller chart to accommodate this "maximum size" label, but we are not showing that label due to occlusions.

To Reproduce
Steps to reproduce the behavior:

  1. Create a vertical bar chart with 3 bars.
  2. Use a very long label as the x value for the bar in the middle of the chart
  3. See the overflow is calculated also if the label is not shown due to its overlap

Expected behaviour
We should limit the size of the tick labels, trim or put the text into multiple lines.
The overflow should be always justified: if we are showing a label that overflows one edge of the axis lets apply the overflow and reduce the chart size. Adjust the overflow depending on the actual overflow of the chart. Use the monotonic hill clumber method to compute the exact overflow

Screenshots
image

Additional context
Previously described in #758

@markov00 markov00 added bug Something isn't working :axis Axis related issue :xy Bar/Line/Area chart related :Lens Kibana Lens related issue labels Nov 19, 2021
@markov00
Copy link
Member Author

markov00 commented Dec 6, 2021

related to #1179

@markov00
Copy link
Member Author

related to #313

@nickofthyme
Copy link
Collaborator

A related aspect to this is when long labels squeeze the axis width assuming they are to be shown then hidden due to inability to show full label. This results in a skinny chart for no reason.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:axis Axis related issue bug Something isn't working Impact:High :Lens Kibana Lens related issue :xy Bar/Line/Area chart related
Projects
None yet
Development

No branches or pull requests

3 participants