From 6c16587b4099df4f0d1f972d111368a1adcad310 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Tue, 20 Oct 2020 12:58:25 +0200 Subject: [PATCH] fixed legend avg network interfaces --- pandora_console/include/functions.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 0147168ebf..a033f33115 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -3753,7 +3753,16 @@ function series_type_graph_array($data, $show_elements_graph) $name_legend .= __('Unit ').' '; $name_legend .= $show_elements_graph['unit'].': '; } else { - $name_legend = $show_elements_graph['labels'][$value['agent_module_id']].': '; + if (isset($show_elements_graph['from_interface']) === true + && (bool) $show_elements_graph['from_interface'] === true + ) { + $label_interfaces = array_flip($show_elements_graph['modules_series']); + $name_legend = $show_elements_graph['labels'][$value['agent_module_id']][$label_interfaces[$value['agent_module_id']]].': '; + } else if (is_array($show_elements_graph['labels'][$value['agent_module_id']]) === true) { + $name_legend = 'Avg: '; + } else { + $name_legend = $show_elements_graph['labels'][$value['agent_module_id']].': '; + } } } else { if (strpos($key, 'baseline') !== false) {