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 titles remain in the same position when chart is rotated #131

Open
2 tasks done
emmacunningham opened this issue Mar 29, 2019 · 2 comments
Open
2 tasks done
Labels
:axis Axis related issue enhancement New feature or request

Comments

@emmacunningham
Copy link
Contributor

emmacunningham commented Mar 29, 2019

Describe the bug
When rotating the chart, the axis titles remain in the same position even though the axes have moved to adjust to the chart rotation (in the gif below, notice that the titles do not move though their corresponding axes do).

To Reproduce
Steps to reproduce the behavior:

  1. Make a chart with an axis
  2. Set the chartRotation to something that is not 0
  3. Axis title remains in its original position

Expected behavior
The axis titles should remain with the rest of the axis and should move along with them if the chart is rotated. (In the below, when rotated 90 deg, 'Left axis' should be positioned as the title for the top axis on the page instead of on the left)

Screenshots

chart_rotation_bug

Version (please complete the following information):

  • OS: all
  • Browser: all
  • Elastic Charts: 3.4.5

Additional context

Axis title positioning computation should take chart rotation into account (I think currently it doesn't).

Errors in browser console
n/a

Kibana Cross Issues

Checklist

  • every related Kibana issue is listed under Kibana Cross Issues list
  • kibana cross issue tag is associated to the issue if any kibana cross issue is present
@emmacunningham emmacunningham added bug Something isn't working :axis Axis related issue labels Mar 29, 2019
@markov00
Copy link
Member

markov00 commented Apr 1, 2019

@emmacunningham this was by "design". Maybe not a proper design :) but the idea was: independently on the rotation of the chart, if you specify an axis on the right, should be always on the right of your view. but you are right, we can think of position prop as: relative to chart, so we can move the axis along with the rotation

@emmacunningham
Copy link
Contributor Author

@markov00 Ah, I understand. For this specific issue, I think regardless of what the position prop means (relative to rotation or absolute), the title should always stick with the axis. The issue here is that the title stays in the same position, but the axis still moves. In the screenshot, for example, when you rotate the chart, the axes "move" so that what used to be the horizontal x axes are now vertical if you rotate by 90 or -90 degrees (and the corresponding rotation for the vertical y axes). But if the axes titles do not move, then the axes are mis-labeled (the labels for x axes are the y axis labels and vice versa). This becomes especially an issue when there are multiple yScales because then it could be confusing if the axes are mislabeled (which is what happens in the screenshot when it's rotate 180 degrees).

@markov00 markov00 added enhancement New feature or request and removed bug Something isn't working labels Mar 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:axis Axis related issue enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants