You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When hovering on plot series with threshold, item.getSeries().getLabel() is null if hovering on values lower than threshold, is correct ("db" in this example) if hovering on valus bigger than threshold.
// create series with label and threshold
Series.create().setLabel("db").setThreshold(Threshold.create().setBelow(1.5).setColor("#ff0000")).setColor("#0000ff");
Internally, the plugin works by splitting the data into two series, above and
below the threshold. The extra series below the threshold will have its label
cleared and the special "originSeries" attribute set to the original series.
You may need to check for this in hover events.
Since I didn't add a getter to originSeries in Series object, you have to get it manually :
OK. Thanks for the answer!
Il 06/dic/2014 09:12 "Nicolas Morel" [email protected] ha scritto:
Hello,
From the documentation of threshold plugin :
Internally, the plugin works by splitting the data into two series, above and
below the threshold. The extra series below the threshold will have its label
cleared and the special "originSeries" attribute set to the original series.
You may need to check for this in hover events.
Since I didn't add a getter to originSeries in Series object, you have to
get it manually :
When hovering on plot series with threshold, item.getSeries().getLabel() is null if hovering on values lower than threshold, is correct ("db" in this example) if hovering on valus bigger than threshold.
// create series with label and threshold
Series.create().setLabel("db").setThreshold(Threshold.create().setBelow(1.5).setColor("#ff0000")).setColor("#0000ff");
// add hover listener
plot.addHoverListener(new PlotHoverListener() {
@OverRide
public void onPlotHover(Plot plot, PlotPosition position, PlotItem item) {
item.getSeries().getLabel();
}
}, true);
The text was updated successfully, but these errors were encountered: