From 0e945c57821757f17131db3ecb34af932b7d8841 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Fri, 28 Mar 2014 17:13:31 +0000 Subject: [PATCH] 2014-03-28 Miguel de Dios * include/functions_graph.php: set the zeroes values in the boolean graph as zeroes values. Incident: #665 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9669 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 7 ++++ pandora_console/include/functions_graph.php | 39 +++++++++++++-------- 2 files changed, 32 insertions(+), 14 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 3a00dca069..6d440d288c 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2014-03-28 Miguel de Dios + + * include/functions_graph.php: set the zeroes values in the boolean + graph as zeroes values. + + Incident: #665 + 2014-03-28 Juan Manuel Ramon * godmode/reporting/map_builder.php diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 9b9f905a71..b2a5411b71 100755 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -2752,21 +2752,32 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events, // Data and zeroes (draw a step) if ($zero == 1 && $count > 0) { - if ($avg_only) { - $chart[$timestamp]['sum'.$series_suffix] = $total; - } - else { - $chart[$timestamp]['sum'.$series_suffix] = $total; - $chart[$timestamp + 1] = array ('sum'.$series_suffix => 0, - //'count' => 0, - //'timestamp_bottom' => $timestamp, - //'timestamp_top' => $timestamp + $interval, - 'min'.$series_suffix => 0, - 'max'.$series_suffix => 0, - 'event'.$series_suffix => $event_value, - 'alert'.$series_suffix => $alert_value); - } + + //New code set 0 if there is a 0 + //Please check the incident #665 + //http://192.168.50.2/integria/index.php?sec=incidents&sec2=operation/incidents/incident_dashboard_detail&id=665 + + + $chart[$timestamp]['sum'.$series_suffix] = 0; $previous_data = 0; + + //Old code that make a AVG + + //~ if ($avg_only) { + //~ $chart[$timestamp]['sum'.$series_suffix] = $total; + //~ } + //~ else { + //~ $chart[$timestamp]['sum'.$series_suffix] = $total; + //~ $chart[$timestamp + 1] = array ('sum'.$series_suffix => 0, + //~ //'count' => 0, + //~ //'timestamp_bottom' => $timestamp, + //~ //'timestamp_top' => $timestamp + $interval, + //~ 'min'.$series_suffix => 0, + //~ 'max'.$series_suffix => 0, + //~ 'event'.$series_suffix => $event_value, + //~ 'alert'.$series_suffix => $alert_value); + //~ } + //~ $previous_data = 0; } else if ($zero == 1) { // Just zeros $chart[$timestamp]['sum'.$series_suffix] = 0;