score:11

Accepted answer

note that there seems to be some changes going on. the actual configuration would depend on which v2.0 you are using.

for version 2.0.0-alpha

set categoryspacing for the xaxes. you can do this globally

chart.defaults.bar.scales.xaxes[0].categoryspacing = 0

or you can do it by chart

...
scales: {
    xaxes: [{
        categoryspacing: 0
    }],
...

fiddle - http://jsfiddle.net/beehe4eg/


for version 1.0.2

adjust the options barvaluespacing and bardatasetspacing to make the bars closer. this will automatically increase their width.

score:17

for me, trying 2.0 beta, what worked was to set the barpercentage on the xaxes scale option.

this is what i used:

var options = {
    data: chartdata,
    type: "bar",
    options: {
        scales: {
            xaxes: [{ barpercentage: 0.5 }]
        }
    }
};
var chart = new chart(chartctx, options);

score:40

for version 2.4.0 barthickness - manually set width of each bar in pixels. if not set, the bars are sized automatically.

options = {
    scales: {
        xaxes: [{
            barthickness : 73
        }]
    }
}

Related Query

More Query from same tag