这是我要从模型中实现的目标:
“>
但这是我到目前为止使用chartjs实现的功能:
“>
这是我的代码
,似乎没有使边框变细。datasets: [ { data: [3, 8, 13, 9, 2], backgroundColor: [ "#D51F1F", "#9B51E0", "#F2994A", "#4BD37B", "#4285F4" ], borderColor: [ 'rgba(255, 99, 132, 1)', 'rgba(54, 162, 235, 1)', 'rgba(255, 206, 86, 1)', 'rgba(75, 192, 192, 1)', 'rgba(153, 102, 255, 1)', 'rgba(255, 159, 64, 1)' ], borderWidth:1, borderDash:[], borderStyle:'dash', line: { borderWidth:1 } }] } const options= { responsive: false, maintainAspectRatio: false, percentageInnerCutout : 0, }
我将borderWidth
设置为1
这是我要从模型中实现的目标:但是,这是我到目前为止使用chartjs实现的目标:这是我的代码数据集:[{数据:[3、8、13、9、2], ...
<Chart
options={{
title: 'Status of Patients',
pieHole: 0.4, //this will change the hole size
legend:'top', //with this you can place desc of each piece
}}
/>
在您的选项中添加cutoutPercentage: 80
。您可以增加它以使甜甜圈图中间的白色区域变大,或减小它以使其变小。您需要弄乱它,以使图表尽可能接近示例。