From: Dan Vanderkam Date: Tue, 25 Nov 2014 21:36:24 +0000 (-0500) Subject: fix issue #494 & expand xAxisLabelWidth; lots of failing tests X-Git-Tag: v1.1.0~9^2~1 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=b504bdd21e3326c339e9babd2c596c87f7295808;p=dygraphs.git fix issue #494 & expand xAxisLabelWidth; lots of failing tests --- diff --git a/dygraph.js b/dygraph.js index 8e15ba6..ab44fac 100644 --- a/dygraph.js +++ b/dygraph.js @@ -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); diff --git a/tests/two-axes-vr.html b/tests/two-axes-vr.html index 12e8025..161f298 100644 --- a/tests/two-axes-vr.html +++ b/tests/two-axes-vr.html @@ -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, {