X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=dygraph.js;h=f736a7e6d4999fe5008a9e70fcc135be379de6fc;hb=3a8dc464e8e7b197d7df18220ab2ad189ff95841;hp=32d1e0dbb27390f653dfbfd60dc7b87d191ac31a;hpb=22186871014d5f553af00d46d6720b40a1d66f07;p=dygraphs.git diff --git a/dygraph.js b/dygraph.js index 32d1e0d..f736a7e 100644 --- a/dygraph.js +++ b/dygraph.js @@ -1160,6 +1160,8 @@ Dygraph.prototype.mouseMove_ = function(event) { var minDist = 1e+100; var idx = -1; for (var i = 0; i < points.length; i++) { + var point = points[i]; + if (point == null) continue; var dist = Math.abs(points[i].canvasx - canvasx); if (dist > minDist) continue; minDist = dist; @@ -1167,7 +1169,8 @@ Dygraph.prototype.mouseMove_ = function(event) { } if (idx >= 0) lastx = points[idx].xval; // Check that you can really highlight the last day's data - if (canvasx > points[points.length-1].canvasx) + var last = points[points.length-1]; + if (last != null && canvasx > last.canvasx) lastx = points[points.length-1].xval; // Extract the points we've selected