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

Y axis tick overlap when using max option #7734

Closed
david-987 opened this issue Aug 28, 2020 · 5 comments · Fixed by #8569
Closed

Y axis tick overlap when using max option #7734

david-987 opened this issue Aug 28, 2020 · 5 comments · Fixed by #8569

Comments

@david-987
Copy link

My Y axis should not be overlapping when using max option, based on the fix introduced in https://github.com/chartjs/Chart.js/pull/5938

image

Codepen: https://codepen.io/david-987/pen/wvGdLGK

Chrome 84.0
Chartjs 2.9.3

@etimberg
Copy link
Member

I believe there is an open issue for this but I can't find it at the moment. At present, there is unfortunately no good way to solve this. The best I can suggest is to use the tick callback to filter out the values you don't want displayed.

@david-987
Copy link
Author

I believe there is an open issue for this but I can't find it at the moment. At present, there is unfortunately no good way to solve this. The best I can suggest is to use the tick callback to filter out the values you don't want displayed.

Thanks. Workaround if you want to remove the highest Y value to avoid overlaps on custom max:

afterBuildTicks: function(scale) {
                  scale.ticks.shift();
                  return;
                },

@Lautarourtiaga
Copy link
Contributor

I think this issue is solved, couldn't reproduce in master.

@LeeLenaleee
Copy link
Collaborator

Still happens in beta 11: https://codepen.io/leelenaleee/pen/poNavNE

@kurkle
Copy link
Member

kurkle commented Mar 4, 2021

minimal repro: https://codepen.io/kurkle/pen/qBqybwm

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

Successfully merging a pull request may close this issue.

5 participants