]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Merge remote-tracking branch 'origin/v2.0-dev' into v2.0-dev
authorTanner Linsley <tannerlinsley@gmail.com>
Fri, 12 Jun 2015 22:39:32 +0000 (16:39 -0600)
committerTanner Linsley <tannerlinsley@gmail.com>
Fri, 12 Jun 2015 22:39:43 +0000 (16:39 -0600)
src/charts/chart.bar.js

index 9b0e2f5242311126f3ae835a3565ee839ff45434..cfada7c59b2d2c033e8d444be01f710bad68128f 100644 (file)
@@ -8,8 +8,6 @@
     var defaultConfig = {
 
         stacked: false,
-        valueSpacing: 5,
-        datasetSpacing: 1,
 
         hover: {
             mode: "label"
@@ -22,6 +20,9 @@
                 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,
@@ -50,6 +51,8 @@
                 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;