Fixed problems with threshold. Ticket: #3777

This commit is contained in:
m-lopez-f 2016-09-07 13:00:25 +02:00
parent 14a627fc33
commit c0d2cf6f8e
1 changed files with 19 additions and 10 deletions

View File

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