fix issue #494 & expand xAxisLabelWidth; lots of failing tests
authorDan Vanderkam <danvdk@gmail.com>
Tue, 25 Nov 2014 21:36:24 +0000 (16:36 -0500)
committerDan Vanderkam <danvdk@gmail.com>
Tue, 25 Nov 2014 21:36:24 +0000 (16:36 -0500)
dygraph.js
tests/two-axes-vr.html

index 8e15ba6..ab44fac 100644 (file)
@@ -359,7 +359,7 @@ Dygraph.DEFAULT_ATTRS = {
   axes: {
     x: {
       pixelsPerLabel: 60,
-      axisLabelWidth: 55,
+      axisLabelWidth: 58,  // TODO(danvk): make these 10-20px different again.
       axisLabelFormatter: Dygraph.dateAxisLabelFormatter,
       valueFormatter: Dygraph.dateValueFormatter,
       drawGrid: true,
@@ -2318,7 +2318,7 @@ Dygraph.prototype.addXTicks_ = function() {
   var xTicks = xAxisOptionsView('ticker')(
       range[0],
       range[1],
-      this.width_,  // TODO(danvk): should be area.width
+      this.plotter_.area.w,  // TODO(danvk): should be area.width
       xAxisOptionsView,
       this);
   // var msg = 'ticker(' + range[0] + ', ' + range[1] + ', ' + this.width_ + ', ' + this.attr_('pixelsPerXLabel') + ') -> ' + JSON.stringify(xTicks);
@@ -2972,7 +2972,7 @@ Dygraph.prototype.computeYAxisRanges_ = function(extremes) {
       var ticker = opts('ticker');
       axis.ticks = ticker(axis.computedValueRange[0],
               axis.computedValueRange[1],
-              this.height_,  // TODO(danvk): should be area.height
+              this.plotter_.area.h,
               opts,
               this);
       // Define the first independent axis as primary axis.
@@ -3003,7 +3003,7 @@ Dygraph.prototype.computeYAxisRanges_ = function(extremes) {
 
       axis.ticks = ticker(axis.computedValueRange[0],
                           axis.computedValueRange[1],
-                          this.height_,  // TODO(danvk): should be area.height
+                          this.plotter_.area.h,
                           opts,
                           this,
                           tick_values);
index 12e8025..161f298 100644 (file)
@@ -54,8 +54,7 @@
               }
             },
             ylabel: 'Primary y-axis',
-            y2label: 'Secondary y-axis',
-            yAxisLabelWidth: 60
+            y2label: 'Secondary y-axis'
           }
       );
 
@@ -83,7 +82,7 @@
           }
       );
 
-      g2 = new Dygraph(
+      g3 = new Dygraph(
           document.getElementById("demodiv_two"),
           data,
           {