4👍
This feature was added in v2.8 in 2019 (https://github.com/chartjs/Chart.js/pull/5951).
You can now use the weight
property to assign relative widths of datasets.
// following Timo Hulzenboom's example
datasets: [
{
data: [50, 30, 20],
backgroundColor: ['#64D28C', '#F49356', '#F45656']
weight: 0.33, // will be half as thick
},
{
data: [memoryUsageValue, leftoverMemory],
backgroundColor: [PercentageColor, '#FFFFFF']
weight: 0.67,
}
]
Edit: additional documentation at https://www.chartjs.org/docs/latest/charts/doughnut.html#styling
0👍
I was also searching for this option havent found it yet.
For now I added an extra dataset with borderWidth: 42 so that the sides of ether the inner data or outdoor
datasets: [
{
data: [100],
backgroundColor: ['#FFFFFF'],
borderWidth: 42
},
{
data: [50, 30, 20],
backgroundColor: ['#64D28C', '#F49356', '#F45656']
},
{
data: [memoryUsageValue, leftoverMemory],
backgroundColor: [PercentageColor, '#FFFFFF']
}
]
-1👍
There is a weight: prob you can add yo your datasets
- [Chartjs]-Chart.js Bar Chart: How to remove space between the bars in v2.3?
- [Chartjs]-Chart.js render in hidden Bootsrap tab
Source:stackexchange.com