Fixed problems with threshold. Ticket: #3777
This commit is contained in:
parent
14a627fc33
commit
c0d2cf6f8e
|
@ -2077,25 +2077,34 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
|
|||
datas.push(this);
|
||||
//}
|
||||
});
|
||||
plot = $.plot($('#' + graph_id), data_base,
|
||||
$.extend(true, {}, options, {
|
||||
yaxis: {max: max_draw},
|
||||
}));
|
||||
thresholded = false;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
|
||||
var max_draw = plot.getAxes().yaxis.datamax;
|
||||
if (max_draw < red_threshold || max_draw < yellow_threshold) {
|
||||
|
||||
var maxim_data = (red_threshold < yellow_threshold) ? yellow_threshold : red_threshold
|
||||
|
||||
plot = $.plot($('#' + graph_id), data_base,
|
||||
$.extend(true, {}, options, {
|
||||
yaxis: {max: maxim_data + (maxim_data*0.5)},
|
||||
}));
|
||||
}
|
||||
datas = add_threshold (data_base, threshold_data, plot.getAxes().yaxis.min, plot.getAxes().yaxis.max,
|
||||
yellow_threshold, red_threshold, extremes, red_up);
|
||||
thresholded = true;
|
||||
|
||||
}
|
||||
|
||||
var max_draw = plot.getAxes().yaxis.datamax;
|
||||
if (max_draw < red_threshold || max_draw < yellow_threshold) {
|
||||
var maxim_data = (red_threshold < yellow_threshold) ? yellow_threshold : red_threshold
|
||||
plot = $.plot($('#' + graph_id), data_base,
|
||||
$.extend(true, {}, options, {
|
||||
yaxis: {max: maxim_data},
|
||||
}));
|
||||
}
|
||||
plot.setData(datas);
|
||||
plot.draw();
|
||||
|
||||
plot.setSelection(currentRanges);
|
||||
//~ plot.setSelection(currentRanges);
|
||||
});
|
||||
|
||||
$('#menu_cancelzoom_' + graph_id).click(function() {
|
||||
|
|
Loading…
Reference in New Issue