diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index a7e0d69d42..93df162faa 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -3545,7 +3545,13 @@ function series_type_graph_array($data, $show_elements_graph) && is_array($show_elements_graph['labels']) && (count($show_elements_graph['labels']) > 0) ) { - $name_legend = $data_return['legend'][$key] = $show_elements_graph['labels'][$value['agent_module_id']].' '; + if ($show_elements_graph['unit']) { + $name_legend = $show_elements_graph['labels'][$value['agent_module_id']].' / '.__('Unit ').' '.$show_elements_graph['unit'].': '; + $data_return['legend'][$key] = $show_elements_graph['labels'][$value['agent_module_id']].' / '.__('Unit ').' '.$show_elements_graph['unit'].': '; + } else { + $name_legend = $show_elements_graph['labels'][$value['agent_module_id']].': '; + $data_return['legend'][$key] = $show_elements_graph['labels'][$value['agent_module_id']].': '; + } } else { if (strpos($key, 'baseline') !== false) { if ($value['unit']) { diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index f07fe1168b..4d1fed36e0 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -1361,7 +1361,7 @@ function graphic_combined_module( $data_module_graph['module_id'] = $agent_module_id; $data_module_graph['unit'] = $module_data['unit']; - // stract data + // Stract data. $array_data_module = grafico_modulo_sparse_data( $agent_module_id, $date_array, @@ -1372,12 +1372,14 @@ function graphic_combined_module( $series_suffix = $i; - // convert to array graph and weight + // Convert to array graph and weight. foreach ($array_data_module as $key => $value) { $array_data[$key] = $value; - if ($params_combined['weight_list'][$i] > 1) { + if ($params_combined['weight_list'][$i] != 1) { foreach ($value['data'] as $k => $v) { - $array_data[$key]['data'][$k][1] = ($v[1] * $params_combined['weight_list'][$i]); + if ($v[1] != false) { + $array_data[$key]['data'][$k][1] = ($v[1] * $params_combined['weight_list'][$i]); + } } } }