0👍
Chart.js doesn’t provide any direct property to customize the margin you are talking about. The only thing you can change is the padding, however, only the top padding is impacted concerning the legend.
According to their doc, a good way to setup this margin is to use the custom HTML Legend : HTML Legend
This method allow you to give any style input in html elements containing the legend.
- Chartjs-How to add an array to my line data?
- Chartjs-Is it possible to fill particular portion between given start & end angle in pie chart in chart.js?
Source:stackexchange.com