You can expand the chart to do this, for example
Chart.types.Bar.extend({ name: "BarAlt", initialize: function(data){ Chart.types.Bar.prototype.initialize.apply(this, arguments); var xLabels = this.scale.xLabels; for (var i = 0; i < xLabels.length; i++) xLabels[i] = ''; } });
and name it like that
var myBarChart = new Chart(ctx).BarAlt(data);
Fiddle - http://jsfiddle.net/kq3utvnu/
Thanks @Samuele for this! For really long labels, you need to set the labels to something shorter, and then return them back to the original ones (in the chart elements) so that the space is not placed below the x axis for the labels.
Chart.types.Bar.extend({ name: "BarAlt", initialize: function(data){ var originalLabels = data.labels; data.labels = data.labels.map(function() { return '' }); Chart.types.Bar.prototype.initialize.apply(this, arguments); this.datasets[0].bars.forEach(function(bar, i) { bar.label = originalLabels[i]; }); var xLabels = this.scale.xLabels; for (var i = 0; i < xLabels.length; i++) xLabels[i] = ''; } });
Fiddle - http://jsfiddle.net/nkbevuoe/
source share