From f7cc30a11d4bb3e49967e09e340d968b727d697c Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Wed, 21 Jun 2017 11:21:10 +0200 Subject: [PATCH] Added good period to fix charts --- pandora_console/include/functions_graph.php | 36 +++++++++++++++------ 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 5cf867be00..a2024a8622 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -356,7 +356,7 @@ function grafico_modulo_sparse_data_chart (&$chart, &$chart_data_extra, &$long_i $time_format = "M \nd H\h"; } else { - $time_format = "M Y"; + $time_format = "Y M \nd H\h"; } } else { @@ -377,7 +377,7 @@ function grafico_modulo_sparse_data_chart (&$chart, &$chart_data_extra, &$long_i $time_format = "M d H\h"; } else { - $time_format = "M Y"; + $time_format = "Y M d H\h"; } } @@ -3674,10 +3674,13 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events, } elseif ($period < SECONDS_1MONTH) { $time_format = 'M d H\h'; - } - else { + } + elseif ($period < SECONDS_6MONTHS) { $time_format = 'M d H\h'; } + else { + $time_format = 'Y M d H\h'; + } $timestamp_short = date($time_format, $timestamp); $long_index[$timestamp_short] = date( @@ -3797,9 +3800,12 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events, elseif ($period < SECONDS_1MONTH) { $time_format = 'M d H\h'; } - else { + elseif ($period < SECONDS_6MONTHS) { $time_format = 'M d H\h'; } + else { + $time_format = 'Y M d H\h'; + } // Flash chart $caption = __('Max. Value').$series_suffix_str . ': ' . $graph_stats['sum']['max'] . ' ' . __('Avg. Value').$series_suffix_str . @@ -4016,9 +4022,12 @@ function graph_netflow_aggregate_area ($data, $period, $width, $height, $unit = elseif ($period < SECONDS_1MONTH) { $chart_time_format = 'M d H\h'; } - else { + elseif ($period < SECONDS_6MONTHS) { $chart_time_format = 'M d H\h'; } + else { + $chart_time_format = 'Y M d H\h'; + } // Calculate source indexes $i = 0; @@ -4141,9 +4150,12 @@ function graph_netflow_total_area ($data, $period, $width, $height, $unit = '', elseif ($period < SECONDS_1MONTH) { $chart_time_format = 'M d H\h'; } - else { + elseif ($period < SECONDS_6MONTHS) { $chart_time_format = 'M d H\h'; } + else { + $chart_time_format = 'Y M d H\h'; + } // Calculate min, max and avg values $avg = 0; @@ -4437,9 +4449,12 @@ function grafico_modulo_string ($agent_module_id, $period, $show_events, elseif ($period < SECONDS_1MONTH) { $time_format = 'M d H\h'; } - else { + elseif ($period < SECONDS_6MONTHS) { $time_format = 'M d H\h'; } + else { + $time_format = 'Y M d H\h'; + } $timestamp_short = date($time_format, $timestamp); $long_index[$timestamp_short] = date( @@ -4612,9 +4627,12 @@ function graphic_module_events ($id_module, $width, $height, $period = 0, $homeu elseif ($period < SECONDS_1MONTH) { $time_format = 'M d H\h'; } - else { + elseif ($period < SECONDS_6MONTHS) { $time_format = 'M d H\h'; } + else { + $time_format = 'Y M d H\h'; + } $legend = array(); $cont = 0;