Chartjs-Chart.js dynamically adjust gap between vertical bars

0👍

In your code, the option xAxis.barThickness defines that the width of individual bars has to be of 15 pixels. Simply remove this option.

You should also consider to use the latest stable version of Chart.js (currently v2.9.3) where the option xAxis.barThickness is deprecated. The options barThickness, barPercentage and categoryPercentage are now part of the dataset configuration.

Leave a comment