这是图表的配置。
const genderConfig={
plugins: {
title: {
display: true,
text: "GENDER",
font: {
size: 20,
},
},
legend: {
labels: {
boxHeight: 20,
boxWidth: 25,
},
position: "bottom",
},
},
}
Ps 我知道有一个非常相似的问题,我已经尝试了该线程中提到的解决方案,但我认为当前版本的 Chart.js 不再存在该解决方案。