From 1b951caf847f8cbb25b504eb9b5b52c0c12a07ab Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Mon, 30 May 2016 17:55:07 +0200 Subject: [PATCH] Apply the fix of the area graph height only to the dashboard and the visual consoles (cherry picked from commit a2ba4acb6cef8d2b986c07d89842fdd95c669e54) --- pandora_console/include/graphs/flot/pandora.flot.js | 8 +++++--- pandora_console/include/graphs/functions_flot.php | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index 845239ecfd..2412da2887 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -805,7 +805,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, alert_ids, legend_alerts, yellow_threshold, red_threshold, force_integer, separator, separator2, yellow_up, red_up, yellow_inverse, red_inverse, - series_suffix_str, vconsole) { + series_suffix_str, dashboard, vconsole) { var threshold = true; var thresholded = false; @@ -1525,8 +1525,10 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, var plot = $.plot($('#' + graph_id), datas, options); // Re-calculate the graph height with the legend height - $('#'+graph_id).css('height', - $('#'+graph_id).height() - $('#legend_'+graph_id).height()); + if (dashboard || vconsole) { + var hDiff = $('#'+graph_id).height() - $('#legend_'+graph_id).height(); + $('#'+graph_id).css('height', hDiff); + } if (vconsole) { var myCanvas = plot.getCanvas(); diff --git a/pandora_console/include/graphs/functions_flot.php b/pandora_console/include/graphs/functions_flot.php index 0c2828fd19..9f84678006 100644 --- a/pandora_console/include/graphs/functions_flot.php +++ b/pandora_console/include/graphs/functions_flot.php @@ -447,7 +447,8 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend, "'$yellow_inverse', \n" . "'$red_inverse', \n" . "'$series_suffix_str', - '$vconsole');"; + " . json_encode($dashboard) . ",\n + " . json_encode($vconsole) . ");"; $return .= "\n//]]>"; $return .= "";