Charts Chart.js更改特定甜甜圈的大小
我只想更改chart.js甜甜圈中的一个部分。可能吗 配置:Charts Chart.js更改特定甜甜圈的大小,charts,Charts,我只想更改chart.js甜甜圈中的一个部分。可能吗 配置: var ctx = document.getElementById("resultChart"); var myChart = new Chart(ctx, { type: "doughnut", data: { labels: ["Red", "Blue"], datasets: [{ label: "# o
var ctx = document.getElementById("resultChart");
var myChart = new Chart(ctx, {
type: "doughnut",
data: {
labels: ["Red", "Blue"],
datasets: [{
label: "# of Votes",
data: [40, 60],
backgroundColor: [
"rgba(33, 178, 82, 1)",
"rgba(239, 239, 239, 1)"
],
hoverBackgroundColor: [
"rgba(33, 178, 82, 1)",
"rgba(239, 239, 239, 1)"
],
shadowOffsetX: [2, 0],
shadowOffsetY: [2, 0],
shadowBlur: [20, 0],
shadowColor: ["rgb(33, 178, 82)", "rgb(239, 239, 239)"],
borderWidth: 0
}]
},
options: {
animation: { duration: 1000 },
cutoutPercentage: 0,
responsive: true,
maintainAspectRatio: false,
rotation: 1 * Math.PI,
circumference: 1 * Math.PI,
legend: {
display: false
},
tooltips: {
enabled: false
},
layout: {
padding: {
left: 20,
bottom: 20,
top: 20,
}
}
}
});
以下是我的结果:
我想这样:
需要减少灰色区域的大小