5๐
โ
I think something like this should work.
plugins: [{
beforeInit: (chart, options) => {
chart.legend.afterFit = () => {
if (chart.legend.margins) {
// Put some padding around the legend/labels
chart.legend.options.labels.padding = 20;
// Because you added 20px of padding around the whole legend,
// you will need to increase the height of the chart to fit it
chart.height += 40;
}
};
}
}]
-4๐
you can use margin-top for #js-legend.
Source:stackexchange.com