Merge commit 'de2545148870a1bdb0957c4c42e80bdb8ce1656d' into per-axis-grid
[dygraphs.git] / dygraph.js
index 30dd88d..cc983a6 100644 (file)
@@ -1025,8 +1025,8 @@ Dygraph.prototype.createInterface_ = function() {
     // 2. e.relatedTarget is outside the chart
     var target = e.target || e.fromElement;
     var relatedTarget = e.relatedTarget || e.toElement;
-    if (Dygraph.isElementContainedBy(target, dygraph.graphDiv) &&
-        !Dygraph.isElementContainedBy(relatedTarget, dygraph.graphDiv)) {
+    if (Dygraph.isNodeContainedBy(target, dygraph.graphDiv) &&
+        !Dygraph.isNodeContainedBy(relatedTarget, dygraph.graphDiv)) {
       dygraph.mouseOut_(e);
     }
   };
@@ -2736,7 +2736,7 @@ Dygraph.prototype.computeYAxisRanges_ = function(extremes) {
         p_axis = axis;
     }
   }
-  if(p_axis == undefined)
+  if(p_axis === undefined)
     throw ("Configuration Error: At least one axis has to have the \"independentTicks\" option activated.");
   // Add ticks. By default, all axes inherit the tick positions of the
   // primary axis. However, if an axis is specifically marked as having
@@ -2780,6 +2780,8 @@ Dygraph.prototype.computeYAxisRanges_ = function(extremes) {
 Dygraph.prototype.extractSeries_ = function(rawData, i, logScale) {
   // TODO(danvk): pre-allocate series here.
   var series = [];
+  var errorBars = this.attr_("errorBars");
+  var customBars =  this.attr_("customBars");
   for (var j = 0; j < rawData.length; j++) {
     var x = rawData[j][0];
     var point = rawData[j][i];
@@ -2790,7 +2792,12 @@ Dygraph.prototype.extractSeries_ = function(rawData, i, logScale) {
         point = null;
       }
     }
-    series.push([x, point]);
+    // Fix null points to fit the display type standard.
+    if(point !== null) {
+      series.push([x, point]);
+    } else {
+      series.push([x, errorBars ? [null, null] : customBars ? [null, null, null] : point]);
+    }
   }
   return series;
 };