[Chartjs]-How to set the gap between data items in a chartjs chart

3๐Ÿ‘

โœ…

I should RTFM.

The solution is on the chartjs website here :

https://www.chartjs.org/docs/latest/configuration/elements.html

This fixed it :

Chart.defaults.global.elements.arc.borderWidth = 1;

2๐Ÿ‘

Set the border width to your desired size

var myDoughnutChart = new Chart(ctx, {
    type: 'doughnut',
    data: data,
    options: options,
    borderWidth: 5 /* change this */
});

Leave a comment