From 72f88816859782ba3ddd1b8d0b55f87543a62ac9 Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Thu, 21 Jul 2016 11:07:09 +0200 Subject: [PATCH] Fixed problems with bullet charts. Tiquet: #3822 --- pandora_console/include/functions_graph.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 3cd5d65f79..00267f9715 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -1401,7 +1401,7 @@ function graphic_combined_module ($module_list, $weight_list, $period, $flash_charts = false; } - if ($flash_charts === false && $stacked == CUSTOM_GRAPH_GAUGE) + if ($flash_charts === false && $stacked == CUSTOM_GRAPH_GAUGE) $stacked = CUSTOM_GRAPH_BULLET_CHART; switch ($stacked) { @@ -1425,7 +1425,10 @@ function graphic_combined_module ($module_list, $weight_list, $period, $value = count($value); } else { - $value = false; + if ($flash_charts === false) + $value = 0; + else + $value = false; } @@ -1436,8 +1439,14 @@ function graphic_combined_module ($module_list, $weight_list, $period, $temp[$module]['label'] = $label; $temp[$module]['value'] = $value; - $temp[$module]['max'] = reporting_get_agentmodule_data_max($module,$period,$date); - $temp[$module]['min'] = reporting_get_agentmodule_data_min($module,$period,$date); + $temp_max = reporting_get_agentmodule_data_max($module,$period,$date); + if ($temp_max < 0) + $temp_max = 0; + $temp[$module]['max'] = ($temp_max === false) ? 0 : $temp_max; + $temp_min = reporting_get_agentmodule_data_min($module,$period,$date); + if ($temp_min < 0) + $temp_min = 0; + $temp[$module]['min'] = ($temp_min === false) ? 0 : $temp_min; } break; case CUSTOM_GRAPH_HBARS: