From: Adam Vartanian Date: Tue, 1 Feb 2011 18:53:32 +0000 (-0500) Subject: Remove code that clamps horizontal hover to the final point. I don't think X-Git-Tag: v1.0.0~587^2~3^2 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=0209e56f5bb5bf7bb35d7d5c9ce2148d423cf2a6;hp=60adad337b790d1e99414a5ca928203fe1326b83;p=dygraphs.git Remove code that clamps horizontal hover to the final point. I don't think these do anything; all tests continue to work fine. This makes it so that if you have two lines, the first of which continues later than the second, hovering will work for the first line at points later than the second ends. Modify connect-separated test to have nulls at end of final dataset, to show the bug fix works. --- diff --git a/dygraph.js b/dygraph.js index 7beeb07..6bdb143 100644 --- a/dygraph.js +++ b/dygraph.js @@ -1411,10 +1411,6 @@ Dygraph.prototype.mouseMove_ = function(event) { idx = i; } if (idx >= 0) lastx = points[idx].xval; - // Check that you can really highlight the last day's data - var last = points[points.length-1]; - if (last != null && canvasx > last.canvasx) - lastx = points[points.length-1].xval; // Extract the points we've selected this.selPoints_ = []; diff --git a/tests/connect-separated.html b/tests/connect-separated.html index 24b87a8..b02ea4f 100644 --- a/tests/connect-separated.html +++ b/tests/connect-separated.html @@ -23,8 +23,8 @@ [ new Date("2009/12/03"), null, null, 12], [ new Date("2009/12/04"), 20, 14, null], [ new Date("2009/12/05"), 15, null, 17], - [ new Date("2009/12/06"), 18, null, 16], - [ new Date("2009/12/07"), 12, 14, 19] + [ new Date("2009/12/06"), 18, null, null], + [ new Date("2009/12/07"), 12, 14, null] ], { connectSeparatedPoints: true,