From: Dan Vanderkam Date: Thu, 15 Nov 2012 16:26:58 +0000 (-0800) Subject: Merge pull request #170 from shole/master X-Git-Tag: v1.0.0~175 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=5baf7a08e52ae0c668c9578bdeb2d63b68f829fc;hp=77cd1f77354144a2ed740909e68de5469c66f9ab;p=dygraphs.git Merge pull request #170 from shole/master findClosestPoint visibility bias fix --- diff --git a/dygraph.js b/dygraph.js index 621ea32..9d58201 100644 --- a/dygraph.js +++ b/dygraph.js @@ -1670,7 +1670,7 @@ Dygraph.prototype.findClosestPoint = function(domX, domY) { var minDist = Infinity; var idx = -1; var dist, dx, dy, point, closestPoint, closestSeries; - for (var setIdx = 0; setIdx < this.layout_.datasets.length; ++setIdx) { + for ( var setIdx = this.layout_.datasets.length - 1 ; setIdx >= 0 ; --setIdx ) { var points = this.layout_.points[setIdx]; for (var i = 0; i < points.length; ++i) { var point = points[i];