Added good period to fix charts

This commit is contained in:
Arturo Gonzalez 2017-06-21 11:21:10 +02:00
parent fe5d34b746
commit f7cc30a11d
1 changed files with 27 additions and 9 deletions
pandora_console/include

View File

@ -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;