diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index 0ecd773296..6078470453 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -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() {