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

[Axis] Padding with fit renders bad axis labels #1640

Open
3 tasks done
Tracked by #2320
nickofthyme opened this issue Apr 4, 2022 · 0 comments
Open
3 tasks done
Tracked by #2320

[Axis] Padding with fit renders bad axis labels #1640

nickofthyme opened this issue Apr 4, 2022 · 0 comments
Assignees
Labels
:axis Axis related issue bug Something isn't working :xy Bar/Line/Area chart related

Comments

@nickofthyme
Copy link
Collaborator

nickofthyme commented Apr 4, 2022

Describe the issue
When using the axis domain.padding option with domain.fit set to true, the labels of the axis are both printed at the bottom of the axis.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/s/billowing-bush-ik5uf2?file=/src/App.tsx
  2. Set padding to 0
  3. Notice the chart is correctly rendered
  4. Set the padding to 50
  5. Notice the axis labels are printed atop each other

Expected behaviour
Axis padding is correctly applied for single values

Screenshots

Current

Screen Recording 2023-08-10 at 12 10 20 PM

Notice when padding is applied, the label shifts to the bottom unexpectedly.

Expected

Screen Recording 2022-04-04 at 09 38 14 AM

Version (please complete the following information):

  • Elastic Charts: latest

Additional context
With only a slight non-zero domain range, the values could be rendered correctly. Seems like a condition that checks for 0 domain delta and returns early. This should be blocked when padding is defined.

Kibana Cross Issues

Checklist

  • The proper chart type label has been added (e.g. :xy, :partition)
  • The proper feature labels have been added (e.g. :interactions, :axis)
  • Every related Kibana issue is listed under Kibana Cross Issues list and the kibana cross issue tag is applied
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 :xy Bar/Line/Area chart related
Projects
None yet
Development

No branches or pull requests

1 participant