From: Dan Vanderkam Date: Mon, 21 Feb 2011 15:31:23 +0000 (-0500) Subject: fix issue 124 X-Git-Tag: v1.0.0~584^2 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=3aa79d94fcdc80ed513c730c9c1a0bb4bb292d61;p=dygraphs.git fix issue 124 --- diff --git a/dygraph.js b/dygraph.js index 4a1cef2..657a405 100644 --- a/dygraph.js +++ b/dygraph.js @@ -1401,6 +1401,9 @@ Dygraph.prototype.mouseMove_ = function(event) { var canvasx = Dygraph.pageX(event) - Dygraph.findPosX(this.mouseEventElement_); var points = this.layout_.points; + // This prevents JS errors when mousing over the canvas before data loads. + if (typeof(points) == 'undefined') return; + var lastx = -1; var lasty = -1;