Merge pull request #194 from kberg/unzoom
[dygraphs.git] / dygraph-options.js
index dc779b1..907811c 100644 (file)
@@ -193,7 +193,7 @@ DygraphOptions.prototype.reparseSeries = function() {
 /**
  * Get a global value.
  *
- * @param {String} name the name of the option.
+ * @param {string} name the name of the option.
  */
 DygraphOptions.prototype.get = function(name) {
   var result = this.getGlobalUser_(name);
@@ -224,9 +224,9 @@ DygraphOptions.prototype.getGlobalDefault_ = function(name) {
  * Get a value for a specific axis. If there is no specific value for the axis,
  * the global value is returned.
  *
- * @param {String} name the name of the option.
- * @param {String|number} axis the axis to search. Can be the string representation
- * ("x", "y", "y2") or the y-axis number (0, 1). (x-axis can't be specified by number.)
+ * @param {string} name the name of the option.
+ * @param {string|number} axis the axis to search. Can be the string representation
+ * ("y", "y2") or the axis number (0, 1).
  */
 DygraphOptions.prototype.getForAxis = function(name, axis) {
   var axisIdx;
@@ -280,25 +280,22 @@ DygraphOptions.prototype.getForAxis = function(name, axis) {
  * Get a value for a specific series. If there is no specific value for the series,
  * the value for the axis is returned (and afterwards, the global value.)
  *
- * @param {String} name the name of the option.
- * @param {String|number} series the series to search. Can be the string representation
- * or 0-offset series number.
+ * @param {string} name the name of the option.
+ * @param {string} series the series to search.
  */
 DygraphOptions.prototype.getForSeries = function(name, series) {
   // Honors indexes as series.
-  var seriesName = (typeof(series) == "number") ? this.labels[series] : series;
-
-  if (seriesName === this.dygraph_.highlightSet_) {
+  if (series === this.dygraph_.highlightSet_) {
     if (this.highlightSeries_.hasOwnProperty(name)) {
       return this.highlightSeries_[name];
     }
   }
 
-  if (!this.series_.hasOwnProperty(seriesName)) {
+  if (!this.series_.hasOwnProperty(series)) {
     throw "Unknown series: " + series;
   }
 
-  var seriesObj = this.series_[seriesName];
+  var seriesObj = this.series_[series];
   var seriesOptions = seriesObj["options"];
   if (seriesOptions.hasOwnProperty(name)) {
     return seriesOptions[name];
@@ -318,8 +315,8 @@ DygraphOptions.prototype.numAxes = function() {
 /**
  * Return the y-axis for a given series, specified by name.
  */
-DygraphOptions.prototype.axisForSeries = function(seriesName) {
-  return this.series_[seriesName].yAxis;
+DygraphOptions.prototype.axisForSeries = function(series) {
+  return this.series_[series].yAxis;
 };
 
 /**