Check this out
barThickness
Manually set width of each bar in pixels. If not set, the base sample
widths are calculated automatically so that they take the full
available widths without overlap. Then, the bars are sized using
barPercentage and categoryPercentage.
Your code should be something like this:
var myBarChart = new Chart(ctx, {
type: 'bar',
data: data,
options: {
scales: {
xAxes: [{
barThickness: 10
}]
}
});
I made this example for you
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…