From c5b942f13f0bc4a560ee8be61197769c179b78c3 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 12 Sep 2018 15:57:22 +0200 Subject: [PATCH] fixed minor error legend graph and value avg --- pandora_console/include/functions_graph.php | 6 ++--- .../include/graphs/flot/pandora.flot.js | 22 ++++++++++--------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index ad6a9857ba..75c08addc2 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -4129,7 +4129,7 @@ function fullscale_data ( if($min_value != PHP_INT_MAX) { $data["min" . $series_suffix]['data'][] = array($real_date , $min_value); } - + if($max_value != -PHP_INT_MAX) { $data["max" . $series_suffix]['data'][] = array($real_date , $max_value); } @@ -4155,7 +4155,7 @@ function fullscale_data ( $min_value_total = $min_value; } //avg sum_total - $sum_data_total += $sum_data; + $sum_data_total += $sum_data/$count_data; //avg count_total $count_data_total++; @@ -4203,6 +4203,7 @@ function fullscale_data ( } } } + $data["sum" . $series_suffix]['min'] = $min_value_total; $data["sum" . $series_suffix]['max'] = $max_value_total; $data["sum" . $series_suffix]['avg'] = $sum_data_total/$count_data_total; @@ -4287,7 +4288,6 @@ function fullscale_data ( $last_data = $v["datos"]; } } - $data["sum" . $series_suffix]['min'] = $min_value; $data["sum" . $series_suffix]['max'] = $max_value; $data["sum" . $series_suffix]['avg'] = $sum_data/$count_data; diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index 0033717955..a71cb5eb19 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -2171,10 +2171,11 @@ function pandoraFlotArea( graph_id, values, legend, } }); - $('#'+graph_id).bind('mouseout',resetInteractivity(vconsole)); - if(!vconsole){ - $('#overview_'+graph_id).bind('mouseout',resetInteractivity); + $('#'+graph_id) + .bind('mouseout', resetInteractivity); + $('#overview_'+graph_id) + .bind('mouseout', resetInteractivity); } if(image_treshold){ @@ -2218,7 +2219,7 @@ function pandoraFlotArea( graph_id, values, legend, } // Reset interactivity styles - function resetInteractivity(vconsole) { + function resetInteractivity() { $('#timestamp_'+graph_id).hide(); dataset = plot.getData(); for (i = 0; i < dataset.length; ++i) { @@ -2227,14 +2228,15 @@ function pandoraFlotArea( graph_id, values, legend, $('#legend_' + graph_id + ' .legendLabel') .eq(i).html(label_aux); } - $('#legend_' + graph_id + ' .legendLabel').css('color', legend_color); - $('#legend_' + graph_id + ' .legendLabel').css('font-size', font_size + 2 +'px'); - $('#legend_' + graph_id + ' .legendLabel').css('font-family', font + 'Font'); + $('#legend_' + graph_id + ' .legendLabel') + .css('color', legend_color); + $('#legend_' + graph_id + ' .legendLabel') + .css('font-size', font_size + 2 +'px'); + $('#legend_' + graph_id + ' .legendLabel') + .css('font-family', font + 'Font'); plot.clearCrosshair(); - if(!vconsole){ - overview.clearCrosshair(); - } + overview.clearCrosshair(); } function yFormatter(v, axis) {