diff --git a/pandora_console/include/functions_custom_graphs.php b/pandora_console/include/functions_custom_graphs.php index fb9dd03d36..55dfee8146 100644 --- a/pandora_console/include/functions_custom_graphs.php +++ b/pandora_console/include/functions_custom_graphs.php @@ -168,11 +168,6 @@ function custom_graphs_print($id_graph, $height, $width, $period, global $config; - // Only avg on dashboard and visual console - if ($dashboard || $vconsole) { - $show_last = $show_min = $show_max = false; - } - if ($id_graph == 0) { $graph_conf['stacked'] = CUSTOM_GRAPH_LINE; } diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index ccc1622be0..444b121ca7 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -484,7 +484,7 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events, $show_alerts = false, $avg_only = 0, $date = 0, $unit = '', $baseline = 0, $return_data = 0, $show_title = true, $projection = false, $adapt_key = '', $compare = false, $series_suffix = '', $series_suffix_str = '', - $show_unknown = false, $percentil = null) { + $show_unknown = false, $percentil = null, $dashboard = false, $vconsole = false) { global $config; global $chart; @@ -733,13 +733,19 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events, $chart_extra_data['legend_alerts'] = $legend['alert'.$series_suffix_str]; } - if (!$avg_only) { + if ($dashboard || $vconsole) { + $legend['sum'.$series_suffix] = + __('Last') . ': ' . rtrim(number_format($graph_stats['sum']['last'], 2), '.0') . ($unit ? ' ' . $unit : '') . ' ; ' + . __('Avg') . ': ' . rtrim(number_format($graph_stats['sum']['avg'], 2), '.0') . ($unit ? ' ' . $unit : ''); + } + else if (!$avg_only) { $legend['max'.$series_suffix] = __('Max').$series_suffix_str.': '.__('Last').': '.rtrim(number_format($graph_stats['max']['last'], 2), '.0').' '.$unit.' ; '.__('Avg').': '.rtrim(number_format($graph_stats['max']['avg'], 2), '.0').' '.$unit.' ; '.__('Max').': '.rtrim(number_format($graph_stats['max']['max'], 2), '.0').' '.$unit.' ; '.__('Min').': '.rtrim(number_format($graph_stats['max']['min'], 2), '.0').' '.$unit.'--> '.__('Selected'); $legend['sum'.$series_suffix] = __('Avg').$series_suffix_str.': '.__('Last').': '.rtrim(number_format($graph_stats['sum']['last'], 2), '.0').' '.$unit.' ; '.__('Avg').': '.rtrim(number_format($graph_stats['sum']['avg'], 2), '.0').' '.$unit.' ; '.__('Max').': '.rtrim(number_format($graph_stats['sum']['max'], 2), '.0').' '.$unit.' ; '.__('Min').': '.rtrim(number_format($graph_stats['sum']['min'], 2), '.0').' '.$unit.'--> '.__('Selected'); $legend['min'.$series_suffix] = __('Min').$series_suffix_str.': '.__('Last').': '.rtrim(number_format($graph_stats['min']['last'], 2), '.0').' '.$unit.' ; '.__('Avg').': '.rtrim(number_format($graph_stats['min']['avg'], 2), '.0').' '.$unit.' ; '.__('Max').': '.rtrim(number_format($graph_stats['min']['max'], 2), '.0').' '.$unit.' ; '.__('Min').': '.rtrim(number_format($graph_stats['min']['min'], 2), '.0').' '.$unit.'--> '.__('Selected'); } - else + else { $legend['sum'.$series_suffix] = __('Avg').$series_suffix_str.': '.__('Last').': '.rtrim(number_format($graph_stats['sum']['last'], 2), '.0').' '.$unit.' ; '.__('Avg').': '.rtrim(number_format($graph_stats['sum']['avg'], 2), '.0').' '.$unit.' ; '.__('Max').': '.rtrim(number_format($graph_stats['sum']['max'], 2), '.0').' '.$unit.' ; '.__('Min').': '.rtrim(number_format($graph_stats['sum']['min'], 2), '.0').' '.$unit.'--> '.__('Selected'); + } //Baseline was replaced by compare graph feature /*if ($baseline) { $legend['baseline'.$series_suffix] = __('Baseline'); @@ -797,7 +803,7 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events, $show_alerts, $avg_only, $date-$period, $unit, $baseline, $return_data, $show_title, $projection, $adapt_key, $compare, $series_suffix, $series_suffix_str, - $show_unknown, $percentil); + $show_unknown, $percentil, $dashboard, $vconsole); @@ -833,7 +839,7 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events, $show_alerts, $avg_only, $date, $unit, $baseline, $return_data, $show_title, $projection, $adapt_key, $compare, '', '', $show_unknown, - $percentil); + $percentil, $dashboard, $vconsole); if ($return_data) { diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index 404a3d4ddd..cee7e89f67 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -774,7 +774,7 @@ function visual_map_print_item($mode = "read", $layoutData, $img = custom_graphs_print( $layoutData['id_custom_graph'], $height, $width, $period, null, true, 0, $only_image, $layoutData['image'], - array(), '', array(), array(), false, + array(), '', array(), array(), true, false, false, true, 1, false, true); } else {