I am trying to increase spacing between legend labels and chart with reactjs
, I've looked for different solutions but most are with vanilla js. I've added this in my chart options based on this answer
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}
/>
)
But it's not working, am I missing something here ?