From b7de2841804094634cb78f87a07fd0941fc74309 Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Thu, 31 Dec 2015 12:04:23 +0100 Subject: [PATCH] Fixed graph event position in modules graph when resizes the window. Ticket#3070 --- pandora_console/include/functions_graph.php | 4 ++-- pandora_console/include/graphs/functions_flot.php | 9 +++++++-- pandora_console/operation/agentes/stat_win.php | 8 ++++---- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 2f1a288dc8..b1d06fa12a 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -4191,7 +4191,7 @@ function grafico_modulo_string ($agent_module_id, $period, $show_events, * @param string adaptation width and margin left key (could be adapter_[something] or adapted_[something]) * @param int date limit of the period */ -function graphic_module_events ($id_module, $width, $height, $period = 0, $homeurl = '', $zoom = 0, $adapt_key = '', $date = false) { +function graphic_module_events ($id_module, $width, $height, $period = 0, $homeurl = '', $zoom = 0, $adapt_key = '', $date = false, $stat_win = false) { global $config; global $graphic_type; @@ -4319,7 +4319,7 @@ function graphic_module_events ($id_module, $width, $height, $period = 0, $homeu // Draw slicebar graph if ($config['flash_charts']) { - echo flot_slicesbar_graph($data, $period, $width, 15, $legend, $colors, $config['fontpath'], $config['round_corner'], $homeurl, '', $adapt_key); + echo flot_slicesbar_graph($data, $period, $width, 15, $legend, $colors, $config['fontpath'], $config['round_corner'], $homeurl, '', $adapt_key, $stat_win); } else { echo slicesbar_graph($data, $period, $width, 15, $colors, $config['fontpath'], $config['round_corner'], $homeurl); diff --git a/pandora_console/include/graphs/functions_flot.php b/pandora_console/include/graphs/functions_flot.php index 26d8aea362..1d7aeae812 100644 --- a/pandora_console/include/graphs/functions_flot.php +++ b/pandora_console/include/graphs/functions_flot.php @@ -742,7 +742,7 @@ function flot_vcolumn_chart ($graph_data, $width, $height, $color, $legend, $lon return $return; } -function flot_slicesbar_graph ($graph_data, $period, $width, $height, $legend, $colors, $fontpath, $round_corner, $homeurl, $watermark = '', $adapt_key = '') { +function flot_slicesbar_graph ($graph_data, $period, $width, $height, $legend, $colors, $fontpath, $round_corner, $homeurl, $watermark = '', $adapt_key = '', $stat_win = false) { global $config; include_javascript_dependencies_flot_graph(); @@ -755,7 +755,12 @@ function flot_slicesbar_graph ($graph_data, $period, $width, $height, $legend, $ $graph_id = uniqid('graph_'); // Set some containers to legend, graph, timestamp tooltip, etc. - $return = "
"; + if ($stat_win) { + $return = "
"; + } + else { + $return = "
"; + } $return .= ""; // Set a weird separator to serialize and unserialize passing data from php to javascript diff --git a/pandora_console/operation/agentes/stat_win.php b/pandora_console/operation/agentes/stat_win.php index ec4280d29c..fc0918cf8a 100644 --- a/pandora_console/operation/agentes/stat_win.php +++ b/pandora_console/operation/agentes/stat_win.php @@ -201,7 +201,7 @@ $id = get_parameter('id'); if ($show_events_graph) echo graphic_module_events($id, $width, $height, $period, $config['homeurl'], $zoom, - 'adapted_' . $graph_type, $date); + 'adapted_' . $graph_type, $date, true); break; case 'sparse': echo grafico_modulo_sparse ($id, $period, $draw_events, @@ -215,7 +215,7 @@ $id = get_parameter('id'); if ($show_events_graph) echo graphic_module_events($id, $width, $height, $period, $config['homeurl'], $zoom, - 'adapted_' . $graph_type, $date); + 'adapted_' . $graph_type, $date, true); break; case 'string': echo grafico_modulo_string ($id, $period, $draw_events, @@ -226,7 +226,7 @@ $id = get_parameter('id'); if ($show_events_graph) echo graphic_module_events($id, $width, $height, $period, $config['homeurl'], $zoom, - 'adapted_' . $graph_type, $date); + 'adapted_' . $graph_type, $date, true); break; case 'log4x': echo grafico_modulo_log4x ($id, $period, $draw_events, @@ -235,7 +235,7 @@ $id = get_parameter('id'); echo '
'; if ($show_events_graph) echo graphic_module_events($id, $width, $height, - $period, $config['homeurl'], $zoom, '', $date); + $period, $config['homeurl'], $zoom, '', $date, true); break; default: echo fs_error_image ('../images');