From 794275a13c68eff20f1c8dc7fb2cb7034834b9b5 Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Mon, 29 Aug 2016 12:35:27 +0200 Subject: [PATCH] Fixed problems with thresholded in interactive graphs. Internal Ticket: #3777 --- pandora_console/include/graphs/flot/pandora.flot.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index 2ab96c063e..0ecd773296 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -2083,7 +2083,15 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, 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();