for one value the bar width is width of canvas so i want only to change the width of bar
how to fix the width of bar size ?
See Question&Answers more detail:osfor one value the bar width is width of canvas so i want only to change the width of bar
how to fix the width of bar size ?
See Question&Answers more detail:osbarThickness
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
}]
}
});