Commit 17ceb51d authored by Ivan Novikov's avatar Ivan Novikov

flot.threshold: insert generated series after original, not in the end

Thus, prevent it from becoming topmost (it may cause strange looks if
original series is not topmost: some part of it becomes topmost and
overwrites some lines and points that should be above it instead).
parent 3c0bcefc
...@@ -103,8 +103,11 @@ You may need to check for this in hover events. ...@@ -103,8 +103,11 @@ You may need to check for this in hover events.
datapoints.points = newpoints; datapoints.points = newpoints;
thresholded.datapoints.points = threspoints; thresholded.datapoints.points = threspoints;
if (thresholded.datapoints.points.length > 0) if (thresholded.datapoints.points.length > 0) {
plot.getData().push(thresholded); var origIndex = $.inArray(s, plot.getData());
// Insert newly-generated series right after original one (to prevent it from becoming top-most)
plot.getData().splice(origIndex + 1, 0, thresholded);
}
// FIXME: there are probably some edge cases left in bars // FIXME: there are probably some edge cases left in bars
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment