From e6cde982f81c36d2359873d156bade89fd4a23bf Mon Sep 17 00:00:00 2001 From: "olau@iola.dk" Date: Tue, 16 Mar 2010 16:17:45 +0000 Subject: [PATCH] Use s.datapoints instead of s.data in highlight(s, index) to lookup point git-svn-id: https://flot.googlecode.com/svn/trunk@239 1e0a6537-2640-0410-bfb7-f154510ff394 --- NEWS.txt | 4 ++++ jquery.flot.js | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/NEWS.txt b/NEWS.txt index 585b1f5..246c9b9 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -31,6 +31,10 @@ Bug fixes: brightness: x, opacity: y }. - Don't use $.browser.msie, check for getContext on the created canvas element instead and try to use excanvas if it's not found. +- highlight(s, index) was looking up the point in the original s.data + instead of in the computed datapoints array, which breaks with + plugins that modify the datapoints (such as the stacking plugin). + Issue 316 reported by curlypaul924. Flot 0.6 -------- diff --git a/jquery.flot.js b/jquery.flot.js index 7942028..73d336a 100644 --- a/jquery.flot.js +++ b/jquery.flot.js @@ -1973,8 +1973,10 @@ if (typeof s == "number") s = series[s]; - if (typeof point == "number") - point = s.data[point]; + if (typeof point == "number") { + var ps = s.datapoints.pointsize; + point = s.datapoints.points.slice(ps * point, ps * (point + 1)); + } var i = indexOfHighlight(s, point); if (i == -1) {