I have a regular Chartjs doughnut chart with multiple datasets, using this code for the dataset:
datasets:
[
{
label: 'Bugs',
data: [ 60 , 6.6666666666667 , 33.333333333333 ],
backgroundColor: ['#25CFE4', '#92E7F1', '#eeeeee'],
}, {
label: 'Fixes',
data: [ 60 , 0.44444444444444 , 39.555555555556 ],
backgroundColor: ['#514463', '#8C75AB', '#eeeeee'],
}, {
label: 'Redesigns',
data: [
33.333333333333 , 10.37037037037 , 56.296296296296 ],
backgroundColor: ['#1B745F', '#40C1A0', '#eeeeee'],
}
]
};
I am trying to implement rounded edges on the scales, I manage to make the first one round, but no luck with the others.
Basically, this is what I have now
And this is what I am trying to achieve (sorry for the poor photoshop)
I don’t mind if the start of the scale is also round or the grey area (which I painted grey just to give the impression of something not yet filled) gas round edges too.
Thanks
3
Answers
This is not the exact answer that you might be looking for but this was my requirement to get rounded edges for multiple datasets. This one rounds off one color in each doughnut dataset.
I used the answer at Chart.js Doughnut with rounded edges and text centered and made some changes. Here is the code:
Fiddle : http://jsfiddle.net/n6vLv1zv/
Hope it brings you one step closer.
Made a few more adjustments and finally got it.This does exactly what you want:
Fiddle – http://jsfiddle.net/tgyxmkLj/1/
I understand this is an older thread, but I have a similar design problem using
"chart.js": "^3.9.1"
and"react-chartjs-2": "^4.3.1"
. My solution was to add 2 "caps" to each arc: one serves as the rounded-spacing between each arcs and one is the rounded cap. Here’s my full code with typings: