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

Wrong tickFormat applied to the value labels #1387

Closed
markov00 opened this issue Sep 20, 2021 · 2 comments · Fixed by #1419
Closed

Wrong tickFormat applied to the value labels #1387

markov00 opened this issue Sep 20, 2021 · 2 comments · Fixed by #1419
Assignees
Labels
:annotation Annotation (line, rect, text) related issue :axis Axis related issue bug Something isn't working Impact:High released Issue released publicly :xy Bar/Line/Area chart related

Comments

@markov00
Copy link
Member

Describe the bug
When rendering dataValues on a bar chart, the tickFormat is only applied with no rotation is applied.
When a rotation is applied, the tickFormat is not considered and the values are rendered without a formatter.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://elastic.github.io/elastic-charts/?path=/story/bar-chart--with-value-label-advanced&globals=theme:light
  2. Rotate the chart 90 degree
  3. Looking at the code, the tickFormat is applied to the left axis, but it still be applied also if the chart is rotated and the driving format axis should be the bottom one (without formatting in the current code)

Expected behaviour
The value label should be formatted with the displayValueSettings.valueFormatter or, as a fallback, the relative Y axis.

Screenshots

Version (please complete the following information):

  • Elastic Charts: master

Additional context
Looks like the getAxesSpecForSpecId doesn't take in consideration the chart rotation

Errors in browser console
n/a

Kibana Cross Issues
elastic/eui#4845 (comment)

@markov00 markov00 added bug Something isn't working :axis Axis related issue :annotation Annotation (line, rect, text) related issue :xy Bar/Line/Area chart related Impact:High labels Sep 20, 2021
@markov00 markov00 self-assigned this Sep 20, 2021
@markov00 markov00 removed their assignment Sep 20, 2021
@rshen91 rshen91 self-assigned this Sep 20, 2021
@rshen91
Copy link
Contributor

rshen91 commented Sep 22, 2021

The y-axis (even if rotated) is dictating the height of the bars. Therefore the tick format from the y-axis should be respected even if it is rotated to be the bottom axis.

@nickofthyme
Copy link
Collaborator

🎉 This issue has been resolved in version 38.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@nickofthyme nickofthyme added the released Issue released publicly label Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:annotation Annotation (line, rect, text) related issue :axis Axis related issue bug Something isn't working Impact:High released Issue released publicly :xy Bar/Line/Area chart related
Projects
None yet
3 participants