From: shole Date: Sat, 27 Oct 2012 15:55:57 +0000 (+0300) Subject: findClosestPoint visibility bias fix, as described in this issue; X-Git-Tag: v1.0.0~175^2 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=cc825c7b029920a3753109cc990bedffb2c8f8f0;p=dygraphs.git findClosestPoint visibility bias fix, as described in this issue; https://code.google.com/p/dygraphs/issues/detail?id=369 --- 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];