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
Stacked bar chart with borderRadius only rounds the last dataset #9217
Comments
It comes from this pull request, #8941 Most likely this behaviour was implemented because for most people this would be the desired behaviour that only the final bar has the border radius. If you really want all bars to have border radius you can still specify the borderRadius as an object defining all corners and then you still have the old behaviour as stated in the docs: https://www.chartjs.org/docs/latest/charts/bar.html#borderradius |
IMO thats super confusing default behaviour. When setting the borderRadius to a number you would expect that the borderRadius was that number :) EDIT: Updating to latest chart.js fixed the problem for me. +1 |
I would like to note, that you can put an array into borderRadius in order to represent each bar. This can be very helpful in many stacked bar charts for example, as I found there sometimes isn't another option with stacked bar charts. For example:
Or as an array of objects:
This is the only solution to a problem with my stacked bar chart I was able to find and it took me long time to realize, so I hope it helps someone. |
Expected Behavior
All bars should be rounded on all edges.
Using borderRadius=500, and borderSkipped=false
On chartjs 3.1.0
Current Behavior
On Chartjs master only one dataset is rounded, the other have sharp edges.
Steps to Reproduce
https://jsfiddle.net/fdrt5y0u/1/
Environment
The text was updated successfully, but these errors were encountered: