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

yAxis labels are not distributed in readable manner when logarithmic scale is used #1798

Open
eldair opened this issue Dec 3, 2024 · 2 comments
Labels

Comments

@eldair
Copy link

eldair commented Dec 3, 2024

Bug description

yAxis labels are smushed together on top values when logarithmic scale is used (in some cases).
https://codepen.io/Eldair/pen/vEBOvYL

Is it possible to add minimum height for yAxis grid/label so that values don't overlap.

@martynasma
Copy link
Collaborator

The treatZeroAs: 0.000001 does not seem like a good idea. I'd go with something like this:

yAxis = chartObject.yAxes.push(
  am5xy.ValueAxis.new(chartRoot, {
    logarithmic: true,
    treatZeroAs: 0.1,
    renderer: chartFormat.yRenderer.new(chartRoot, {
      minGridDistance: 50
    }),
  })
);

@eldair
Copy link
Author

eldair commented Dec 5, 2024

@martynasma thanks, that helped except minGridDistance which is not enough and that is my next point/question, it is not granular enough but I will make another post when I gather enough examples - our entire app is based on programmatic charts so I can observe lots of edge cases.
Also, 0.000001 is from the docs, maybe it should be updated https://www.amcharts.com/docs/v5/charts/xy-chart/axes/value-axis/#Avoiding_zero_values

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants