Fixed problems with labels in custom graphs when use this type en reports

(cherry picked from commit 8c08a8c997)
This commit is contained in:
m-lopez-f 2016-09-14 12:27:18 +02:00
parent 02ee7bdb83
commit 8905b97fbb
1 changed files with 8 additions and 6 deletions

View File

@ -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'] = '';