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) {