var defaultConfig = {
stacked: false,
- valueSpacing: 5,
- datasetSpacing: 1,
hover: {
mode: "label"
position: "bottom",
id: "x-axis-1", // need an ID so datasets can reference the scale
+ categorySpacing: 10,
+ spacing: 1,
+
// grid line settings
gridLines: {
show: true,
position: "left",
id: "y-axis-1",
+ spacing: 1,
+
// grid line settings
gridLines: {
show: true,
this.max = this.labels.length;
},
calculateBaseWidth: function() {
- return (this.getPixelForValue(null, 1, true) - this.getPixelForValue(null, 0, true)) - (2 * self.options.valueSpacing);
+ return (this.getPixelForValue(null, 1, true) - this.getPixelForValue(null, 0, true)) - (2 * this.options.categorySpacing);
},
calculateBarWidth: function(datasetCount) {
//The padding between datasets is to the right of each bar, providing that there are more than 1 dataset
- var baseWidth = this.calculateBaseWidth() - ((datasetCount - 1) * self.options.datasetSpacing);
+ var baseWidth = this.calculateBaseWidth() - ((datasetCount - 1) * this.options.spacing);
if (self.options.stacked) {
return baseWidth;
return xAbsolute + barWidth / 2;
}
- return xAbsolute + (barWidth * datasetIndex) + (datasetIndex * self.options.datasetSpacing) + barWidth / 2;
+ return xAbsolute + (barWidth * datasetIndex) + (datasetIndex * this.options.spacing) + barWidth / 2;
},
});
this.scales[xScale.id] = xScale;