是否有可能使chart.js甜甜圈图表的一部分比其他部分更厚?
有没有可能使蓝色的切片比紫色的切片厚25%?
这是演示中的代码.
const config: ChartConfiguration = {
type: 'doughnut',
data: {
labels: ['Red', 'Blue'],
datasets: [
{
hoverOffset: 24,
backgroundColor: ['rgb(255, 9, 132)', 'rgb(54, 162, 235)'],
borderWidth: 0,
label: '# of Points',
data: [75, 25],
},
],
},
options: {
plugins: {
legend: {
display: false,
},
tooltip: {
mode: 'index',
intersect: false,
position: 'nearest',
},
},
scales: {
y: {
min: 0,
max: 20,
},
},
},
};
new Chart(ctx, config);