fixed weight legend

This commit is contained in:
Daniel Barbero Martin 2020-06-29 15:37:37 +02:00
parent 57c7a98990
commit 595339613b
2 changed files with 21 additions and 5 deletions

View File

@ -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) { if ((int) $value['min'] === PHP_INT_MAX) {
$value['min'] = 0; $value['min'] = 0;
} }

View File

@ -1504,19 +1504,28 @@ function graphic_combined_module(
foreach ($value['data'] as $k => $v) { foreach ($value['data'] as $k => $v) {
if ($v[1] != false) { if ($v[1] != false) {
$array_data[$key]['data'][$k][1] = ($v[1] * $params_combined['weight_list'][$i]); $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];
} }
} }
$max = $array_data['sum'.$i]['max']; $array_data[$key]['max'] *= $params_combined['weight_list'][$i];
$min = $array_data['sum'.$i]['min']; $array_data[$key]['min'] *= $params_combined['weight_list'][$i];
$avg = $array_data['sum'.$i]['avg']; $array_data[$key]['avg'] *= $params_combined['weight_list'][$i];
$array_data[$key]['weight'] = $params_combined['weight_list'][$i];
}
}
if ($config['fixed_graph'] == false) { if ($config['fixed_graph'] == false) {
$water_mark = [ $water_mark = [
'file' => $config['homedir'].'/images/logo_vertical_water.png', '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
),
]; ];
} }