Remove code that clamps horizontal hover to the final point. I don't think
authorAdam Vartanian <flooey@gmail.com>
Tue, 1 Feb 2011 18:53:32 +0000 (13:53 -0500)
committerAdam Vartanian <flooey@gmail.com>
Tue, 1 Feb 2011 19:02:09 +0000 (14:02 -0500)
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.

dygraph.js
tests/connect-separated.html

index 7beeb07..6bdb143 100644 (file)
@@ -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_ = [];
index 24b87a8..b02ea4f 100644 (file)
@@ -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,