Merge branch 'master' of github.com:danvk/dygraphs
[dygraphs.git] / dygraph.js
index 2e8a38e..d89056e 100644 (file)
@@ -556,7 +556,7 @@ Dygraph.prototype.toDataYCoord = function(y, axis) {
 
   if (typeof(axis) == "undefined") axis = 0;
   if (!this.axes_[axis].logscale) {
-    return yRange[0] + (area.h - y) / area.h * (yRange[1] - yRange[0]);
+    return yRange[0] + (area.y + area.h - y) / area.h * (yRange[1] - yRange[0]);
   } else {
     // Computing the inverse of toDomCoord.
     var pct = (y - area.y) / area.h
@@ -3715,7 +3715,8 @@ Dygraph.prototype.start_ = function() {
       var caller = this;
       req.onreadystatechange = function () {
         if (req.readyState == 4) {
-          if (req.status == 200) {
+          if (req.status == 200 ||  // Normal http
+              req.status == 0) {    // Chrome w/ --allow-file-access-from-files
             caller.loadedEvent_(req.responseText);
           }
         }
@@ -4199,6 +4200,12 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
     "type": "integer",
     "description": "Width, in pixels, of the x-axis labels."
   },
+  "xAxisHeight": {
+    "default": "(null)",
+    "labels": ["Axis display"],
+    "type": "integer",
+    "description": "Height, in pixels, of the x-axis. If not set explicitly, this is computed based on axisLabelFontSize and axisTickSize."
+  },
   "showLabelsOnHighlight": {
     "default": "true",
     "labels": ["Interactive Elements", "Legend"],
@@ -4416,7 +4423,7 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
   },
   "panEdgeFraction": {
     "default": "null",
-    "labels": ["Axis Display", "Interactive Elements"],
+    "labels": ["Axis display", "Interactive Elements"],
     "type": "float",
     "default": "null",
     "description": "A value representing the farthest a graph may be panned, in percent of the display. For example, a value of 0.1 means that the graph can only be panned 10% pased the edges of the displayed values. null means no bounds."
@@ -4507,7 +4514,7 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
   },
   "fillAlpha": {
     "default": "0.15",
-    "labels": ["Error bars", "Data Series Colors"],
+    "labels": ["Error Bars", "Data Series Colors"],
     "type": "float (0.0 - 1.0)",
     "description" : "Error bars (or custom bars) for each series are drawn in the same color as the series, but with partial transparency. This sets the transparency. A value of 0.0 means that the error bars will not be drawn, whereas a value of 1.0 means that the error bars will be as dark as the line for the series itself. This can be used to produce chart lines whose thickness varies at each point."
   },
@@ -4592,6 +4599,7 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
     var labels = op['labels'];
     if (typeof(labels) !== 'object') {
       warn('Option "' + k + '" is missing a "labels": [...] option');
+    } else {
       for (var i = 0; i < labels.length; i++) {
         if (!cats.hasOwnProperty(labels[i])) {
           warn('Option "' + k + '" has label "' + labels[i] +