diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index f5d9cdc5e5..23773a2934 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -3724,6 +3724,13 @@ function series_type_graph_array($data, $show_elements_graph) } } + if (isset($value['weight']) === true + && empty($value['weight']) === false + ) { + $name_legend .= ' ('.__('Weight').' * '.$value['weight'].') '; + $data_return['legend'][$key] .= ' ('.__('Weight').' * '.$value['weight'].') '; + } + if ((int) $value['min'] === PHP_INT_MAX) { $value['min'] = 0; } diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index d462929cff..3378b5d80c 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -1504,19 +1504,28 @@ function graphic_combined_module( foreach ($value['data'] as $k => $v) { if ($v[1] != false) { $array_data[$key]['data'][$k][1] = ($v[1] * $params_combined['weight_list'][$i]); + $array_data[$key]['slice_data'][$v[0]]['avg'] *= $params_combined['weight_list'][$i]; + $array_data[$key]['slice_data'][$v[0]]['min'] *= $params_combined['weight_list'][$i]; + $array_data[$key]['slice_data'][$v[0]]['max'] *= $params_combined['weight_list'][$i]; } } + + $array_data[$key]['max'] *= $params_combined['weight_list'][$i]; + $array_data[$key]['min'] *= $params_combined['weight_list'][$i]; + $array_data[$key]['avg'] *= $params_combined['weight_list'][$i]; + $array_data[$key]['weight'] = $params_combined['weight_list'][$i]; } } - $max = $array_data['sum'.$i]['max']; - $min = $array_data['sum'.$i]['min']; - $avg = $array_data['sum'.$i]['avg']; - if ($config['fixed_graph'] == false) { $water_mark = [ 'file' => $config['homedir'].'/images/logo_vertical_water.png', - 'url' => ui_get_full_url('images/logo_vertical_water.png', false, false, false), + 'url' => ui_get_full_url( + 'images/logo_vertical_water.png', + false, + false, + false + ), ]; }