-
Notifications
You must be signed in to change notification settings - Fork 12k
Fix: display stacked bar with multiple x-Axis #12070
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
Fix: display stacked bar with multiple x-Axis #12070
Conversation
@LeeLenaleee thanks for the approval on the pipeline, do you have an idea why it failed ? It seems to be unrelated to my changes ? |
Sorry I have not had the time to give the tests a good look, I will try to look at it later this week |
@LeeLenaleee Hi there, do you we can retry the pipeline to see if it's still failing ? 🙏 |
@xavierleune I re-ran the pipeline to see. It looked like an image difference was detected. If it fails again, I'll look a bit more closely |
ok, it failed again. The failing image is https://github.com/chartjs/Chart.js/blob/master/test/fixtures/scale.linear/grace/grace-beginAtZero.png Not sure why that's failing only on ubuntu, but I wonder if the failure is due to the test having multiple x axes and now the image has changed. I'm a bit hesitant to change the tolerance on that test without knowing why it has changed. Are you able to run the test locally and see? |
thanks for the feedback @etimberg I'll have a look on that test 👍 |
Ok I see, this test use: |
This should be correct now, I carefuly reviewed the tests and I think the other failures are only due to fonts mismatch and so... 🤞 |
Hello everyone,
When you try to use stackedBars with multiple axes, the bars all render at the center of each axis chunk, so they're hidden by whichever bar is rendered last.
You can see a live example on codepen
This pull request fixes this behavior. It counts the number of x axes and adjusts size and positions according to that number.
As this is my first pull request on this project, I may have missed something. If that's so, please tell me.
Have a nice day !