From e237198d06e3063197e472cd73581a38aed5afed Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Tue, 13 Jun 2017 09:26:08 +0200 Subject: [PATCH 1/2] Added a final fix --- pandora_console/include/functions_graph.php | 37 ++++++++++----------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index a735860542..890660617d 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -267,26 +267,25 @@ function grafico_modulo_sparse_data_chart (&$chart, &$chart_data_extra, &$long_i $interval_min = false; $interval_max = false; - if (!$fullscale) { - while (isset ($data[$data_i]) && $data[$data_i]['utimestamp'] >= $timestamp && $data[$data_i]['utimestamp'] < ($timestamp + $interval)) { - if ($interval_min === false) { - $interval_min = $data[$data_i]['datos']; - } - if ($interval_max === false) { - $interval_max = $data[$data_i]['datos']; - } - - if ($data[$data_i]['datos'] > $interval_max) { - $interval_max = $data[$data_i]['datos']; - } - else if ($data[$data_i]['datos'] < $interval_min) { - $interval_min = $data[$data_i]['datos']; - } - $total += $data[$data_i]['datos']; - $last_known = $data[$data_i]['datos']; - $count++; - $data_i++; + while (isset ($data[$data_i]) && $data[$data_i]['utimestamp'] >= $timestamp && $data[$data_i]['utimestamp'] < ($timestamp + $interval)) { + if ($interval_min === false) { + $interval_min = $data[$data_i]['datos']; } + if ($interval_max === false) { + $interval_max = $data[$data_i]['datos']; + } + + if ($data[$data_i]['datos'] > $interval_max) { + $interval_max = $data[$data_i]['datos']; + } + else if ($data[$data_i]['datos'] < $interval_min) { + $interval_min = $data[$data_i]['datos']; + } + + $total += $data[$data_i]['datos']; + $last_known = $data[$data_i]['datos']; + $count++; + $data_i++; } if ($max_value < $interval_max) { From c506c9cce6035d80f3471cb38bdd914730089102 Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Tue, 13 Jun 2017 09:45:08 +0200 Subject: [PATCH 2/2] Added a condition to small charts --- pandora_console/include/functions_graph.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 890660617d..dd5fa38883 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -256,7 +256,7 @@ function grafico_modulo_sparse_data_chart (&$chart, &$chart_data_extra, &$long_i for ($i = 0; $i <= $resolution; $i++) { $timestamp = $datelimit + ($interval * $i); - if ($fullscale) { + if ($fullscale && $resolution > 250) { $timestamp = $data[$i]['utimestamp']; }