diff --git a/src/controllers/controller.bar.js b/src/controllers/controller.bar.js index 9574ed2e37d..d0761f5b4cd 100644 --- a/src/controllers/controller.bar.js +++ b/src/controllers/controller.bar.js @@ -184,6 +184,12 @@ module.exports = function(Chart) { var categoryWidth = tickWidth * xScale.options.categoryPercentage; var categorySpacing = (tickWidth - (tickWidth * xScale.options.categoryPercentage)) / 2; var fullBarWidth = categoryWidth / datasetCount; + + if (xScale.ticks.length !== this.chart.data.labels.length) { + var perc = xScale.ticks.length / this.chart.data.labels.length; + fullBarWidth = fullBarWidth * perc; + } + var barWidth = fullBarWidth * xScale.options.barPercentage; var barSpacing = fullBarWidth - (fullBarWidth * xScale.options.barPercentage);