From 8905b97fbbafaae262b0829f34e7ed7634bb1148 Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Wed, 14 Sep 2016 12:27:18 +0200 Subject: [PATCH] Fixed problems with labels in custom graphs when use this type en reports (cherry picked from commit 8c08a8c997750e9efa1b4bf9620a7d5819c15b59) --- pandora_console/include/functions_reporting.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index a76395f6db..89cecfcca3 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -4355,6 +4355,7 @@ function reporting_custom_graph($report, $content, $type = 'dinamic', if ($graphs === false) $graphs = array(); + $labels = array(); foreach ($graphs as $graph_item) { if ($type_report == 'automatic_graph') { array_push ($modules, array( @@ -4366,12 +4367,13 @@ function reporting_custom_graph($report, $content, $type = 'dinamic', } array_push ($weights, $graph_item["weight"]); - } - - $labels = array(); - if (in_array('label',$content['style'])) { - $label = reporting_label_macro($content, $content['style']['label']); - $labels = array_fill_keys($modules, $label); + if (in_array('label',$content['style'])) { + $item = array('type' => 'custom_graph', + 'id_agent' =>modules_get_agentmodule_agent($graph_item['id_agent_module']), + 'id_agent_module'=>$graph_item['id_agent_module']); + $label = reporting_label_macro($item, $content['style']['label']); + $labels[$graph_item['id_agent_module']] = $label; + } } $return['chart'] = '';