Kau*_*Zaw 8 charts reactjs chart.js
我正在尝试增加图例标签和图表之间的间距reactjs,我寻找了不同的解决方案,但大多数都是使用普通js。我已根据此答案将其添加到我的图表选项中
const DoughnutOptions = {
plugins: [
{
beforeInit: function (chart, options) {
chart.legend.afterFit = function () {
this.height = this.height + 50;
};
}
},
{
labels: {
render: "percentage",
fontColor: ["black", "white"],
},
},
]
}
return (
<Doughnut
data={DoughnutData}
options={DoughnutOptions}
/>
)
Run Code Online (Sandbox Code Playgroud)
但它不起作用,我在这里错过了什么吗?
| 归档时间: |
|
| 查看次数: |
4621 次 |
| 最近记录: |