+/**
+ * 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
+ * ("y", "y2") or the axis number (0, 1).
+ */
+DygraphOptions.prototype.getForAxis = function(name, axis) {
+ var axisIdx = 0;
+ if (typeof(axis) == 'number') {
+ axisIdx = axis;
+ } else {
+ // TODO(konigsberg): Accept only valid axis strings?
+ axisIdx = (axis == "y2") ? 1 : 0;
+ }