2👍
According to this github issue you cannot change the space between bars if you decide to set a barThickness
(I assume it does not work when maxBarThickness
is set either but I might be wrong, if so I’ll delete this answer)
According to the previous link, you have two solutions:
- If you want to keep your bar thickness (answer to the github issue):
If you don’t want to stretch out the bar to fill the extra space, you have to reduce the width of the canvas.
-
Otherwise you could set a
barPercentage
and acategoryPercentage
on your chart, without abarThickness
or amaxBarThickness
:scales: { xAxes: [{ categoryPercentage: 0.8, barPercentage: 0.9 }] },
Those are the default values.
Related questions :
Chart.js Bar Chart: How to remove space between the bars in v2.3?
Source:stackexchange.com