[Chartjs]-Specify bar width for a single bar

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;
    }

Leave a comment