From: Dan Vanderkam Date: Fri, 5 Feb 2010 05:36:21 +0000 (-0800) Subject: highlight callback only when selected point changes X-Git-Tag: v1.0.0~739 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=dd082ddacec9e50c76d626495a2eeb8bf3f8ff28;p=dygraphs.git highlight callback only when selected point changes --- diff --git a/dygraph.js b/dygraph.js index 8a303a0..d9c0e27 100644 --- a/dygraph.js +++ b/dygraph.js @@ -782,7 +782,11 @@ Dygraph.prototype.mouseMove_ = function(event) { } if (this.attr_("highlightCallback")) { - this.attr_("highlightCallback")(event, lastx, this.selPoints_); + var px = this.lastHighlightCallbackX; + if (px !== null && lastx != px) { + this.attr_("highlightCallback")(event, lastx, this.selPoints_); + this.lastHighlightCallbackX = lastx; + } } // Clear the previously drawn vertical, if there is one