From: Robert Konigsberg Date: Fri, 28 Jan 2011 22:08:02 +0000 (-0500) Subject: Adding an axis id to the y axes. X-Git-Tag: v1.0.0~584^2~5 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=ab51ff66f384a53fa8757833c3c95047123ad216;p=dygraphs.git Adding an axis id to the y axes. This will be necessary for generating tick marks, since it doesn't take an axis number, it just takes the props themselves. --- diff --git a/dygraph.js b/dygraph.js index 6f5d239..0989a1d 100644 --- a/dygraph.js +++ b/dygraph.js @@ -2117,7 +2117,7 @@ Dygraph.prototype.drawGraph_ = function() { * indices are into the axes_ array. */ Dygraph.prototype.computeYAxes_ = function() { - this.axes_ = [{}]; // always have at least one y-axis. + this.axes_ = [{ yAxisId: 0 }]; // always have at least one y-axis. this.seriesToAxisMap_ = {}; // Get a list of series names. @@ -2157,9 +2157,11 @@ Dygraph.prototype.computeYAxes_ = function() { var opts = {}; Dygraph.update(opts, this.axes_[0]); Dygraph.update(opts, { valueRange: null }); // shouldn't inherit this. + var yAxisId = this.axes_.length; + opts.yAxisId = yAxisId; Dygraph.update(opts, axis); this.axes_.push(opts); - this.seriesToAxisMap_[seriesName] = this.axes_.length - 1; + this.seriesToAxisMap_[seriesName] = yAxisId; } }