2๐
โ
You can get around by changing this property to a higher value when you have only a bar, for example:
//Number - Spacing between each of the X value sets
maxBarThickness: 150
Check here how to use this option.
0๐
I just added null labels if the number of items was below my threshold.
const chartLabels = this.prodChart.chart.config.data.labels;
if (chartLabels.length < 8) {
chartLabels.length = 8;
}
Source:stackexchange.com