Better name (thanks Paul.)
[dygraphs.git] / dygraph.js
index 2bccd60..c867c66 100644 (file)
@@ -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')
@@ -1459,10 +1462,8 @@ Dygraph.prototype.doZoomY_ = function(lowY, highY) {
 /**
  * Reset the zoom to the original view coordinates. This is the same as
  * double-clicking on the graph.
- *
- * @private
  */
-Dygraph.prototype.doUnzoom_ = function() {
+Dygraph.prototype.resetZoom = function() {
   var dirty = false, dirtyX = false, dirtyY = false;
   if (this.dateWindow_ !== null) {
     dirty = true;
@@ -2452,23 +2453,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.