From dd082ddacec9e50c76d626495a2eeb8bf3f8ff28 Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Thu, 4 Feb 2010 21:36:21 -0800 Subject: [PATCH] highlight callback only when selected point changes --- dygraph.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- 2.7.4