From 02c93ff56e47163fa45a7b4d671aa9958702fc6f Mon Sep 17 00:00:00 2001 From: Robert Konigsberg Date: Sat, 24 Nov 2012 23:19:15 -0500 Subject: [PATCH] Ooh more code cleanup; all 155 tests pass. --- dygraph.js | 34 +++------------------------------- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/dygraph.js b/dygraph.js index 1193e74..c71d44f 100644 --- a/dygraph.js +++ b/dygraph.js @@ -2436,40 +2436,12 @@ Dygraph.prototype.computeYAxes_ = function() { // this.axes_ doesn't match this.attributes_.axes_.options. It's used for // data computation as well as options storage. - this.axes_ = []; - for (axis = 0; axis < this.attributes_.numAxes(); axis++) { - this.axes_.push({ yAxisId : i, g : this }); - } - - // all options which could be applied per-axis: - // TODO(konigsberg) - var globalAxisOptions = [ - 'includeZero', - 'valueRange', - 'labelsKMB', - 'labelsKMG2', - 'pixelsPerYLabel', - 'yAxisLabelWidth', - 'axisLabelFontSize', - 'axisTickSize', - 'logscale' - ]; - - // Copy global axis options over to the first axis. - for (i = 0; i < globalAxisOptions.length; i++) { - var k = globalAxisOptions[i]; - v = this.attr_(k); - if (v) this.axes_[0][k] = v; - } - // Go through once and add all the axes. + this.axes_ = []; - // This seems to be right - starting at 1. I think this gets simpler now. - for (axis = 1; axis < this.attributes_.numAxes(); axis++) { + for (axis = 0; axis < this.attributes_.numAxes(); axis++) { // Add a new axis, making a copy of its per-axis options. - opts = {}; - Dygraph.update(opts, this.axes_[0]); - Dygraph.update(opts, { valueRange: null }); // shouldn't inherit this. + opts = { g : this }; Dygraph.update(opts, this.attributes_.axisOptions(axis)); this.axes_[axis] = opts; } -- 2.7.4