From 328891e7a183ef48a4df2671319e6ab1d7c023d9 Mon Sep 17 00:00:00 2001 From: juanmanuelr Date: Thu, 2 Feb 2012 19:00:56 +0000 Subject: [PATCH] 2012-02-02 Juan Manuel Ramon * include/functions_graph.php: Fixed a bug in flash charts due to my last commit. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5478 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 ++ pandora_console/include/functions_graph.php | 51 +++++++++++++++------ 2 files changed, 41 insertions(+), 15 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index a73b27b740..e3f9e8d7ba 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2012-02-02 Juan Manuel Ramon + + * include/functions_graph.php: Fixed a bug in flash charts due to + my last commit. + 2012-02-02 Juan Manuel Ramon * include/functions_graph.php diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 045e56ec1e..f3ac2801f9 100755 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -50,6 +50,8 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events, if ($uncompressed_module) { $avg_only = 1; } + + $flash_chart = $config['flash_charts']; // Get event data (contains alert data too) if ($show_events == 1 || $show_alerts == 1) { @@ -196,23 +198,43 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events, $k++; } - // Set the title and time format - if ($period <= 21600) { - $time_format = 'H:i:s'; + if (!$flash_chart) { + // Set the title and time format + if ($period <= 21600) { + $time_format = 'H:i:s'; + } + elseif ($period < 86400) { + $time_format = 'H:i'; + } + elseif ($period < 1296000) { + $time_format = "M \nd H:i"; + } + elseif ($period < 2592000) { + $time_format = "M \nd H\h"; + } + else { + $time_format = "M \nd H\h"; + } } - elseif ($period < 86400) { - $time_format = 'H:i'; - } - elseif ($period < 1296000) { - $time_format = "M \nd H:i"; - } - elseif ($period < 2592000) { - $time_format = "M \nd H\h"; - } else { - $time_format = "M \nd H\h"; + // Set the title and time format + if ($period <= 21600) { + $time_format = 'H:i:s'; + } + elseif ($period < 86400) { + $time_format = 'H:i'; + } + elseif ($period < 1296000) { + $time_format = "M d H:i"; + } + elseif ($period < 2592000) { + $time_format = "M d H\h"; + } + else { + $time_format = "M d H\h"; + } } - + $timestamp_short = date($time_format, $timestamp); $long_index[$timestamp_short] = date( html_entity_decode($config['date_format'], ENT_QUOTES, "UTF-8"), $timestamp); @@ -331,7 +353,6 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events, $legend['min'] = __('Min') . ' (' . format_for_graph($min_value) . ')'; $legend['baseline'] = __('Baseline'); - $flash_chart = $config['flash_charts']; if ($only_image) { $flash_chart = false; }