X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=dygraph.js;h=4c8c65db1b8f2035af1d19265502741859a3aad8;hb=7ff98630ca7cc2760e2115ad2372053184d3e717;hp=2bccd60a7170937193d52c16485ef8c07a928315;hpb=0a7181dd7099f3959e7b626f10f2dc9825d014cc;p=dygraphs.git diff --git a/dygraph.js b/dygraph.js index 2bccd60..4c8c65d 100644 --- a/dygraph.js +++ b/dygraph.js @@ -598,6 +598,9 @@ Dygraph.prototype.getOption = function(name, opt_seriesName) { return this.attr_(name, opt_seriesName); }; +Dygraph.prototype.getOptionForAxis = function(name, axis) { + return this.attributes_.getForAxis(name, axis); +} /** * @private * @param String} axis The name of the axis (i.e. 'x', 'y' or 'y2') @@ -2452,23 +2455,13 @@ Dygraph.prototype.computeYAxes_ = function() { this.axes_[axis] = opts; } - // TODO(konigsberg): REMOVE THIS SILLINESS this should just come from DygraphOptions. - // TODO(konigsberg): Add tests for all of these. - - // all options which could be applied per-axis: - var axisOptions = [ - 'valueRange', - 'pixelsPerYLabel', - 'axisLabelFontSize', - ]; - // Copy global axis options over to the first axis. - for (i = 0; i < axisOptions.length; i++) { - var k = axisOptions[i]; - v = this.attr_(k); - if (v) this.axes_[0][k] = v; - } - // TODO(konigsberg): end of REMOVE THIS SILLINESS + // Copy global valueRange option over to the first axis. + // NOTE(konigsberg): Are these two statements necessary? + // I tried removing it. The automated tests pass, and manually + // messing with tests/zoom.html showed no trouble. + v = this.attr_('valueRange'); + if (v) this.axes_[0].valueRange = v; if (valueWindows !== undefined) { // Restore valueWindow settings.