Fixed problems with legend when no interactive charts is activated

(cherry picked from commit fc0dc53730)
This commit is contained in:
m-lopez-f 2016-11-10 16:55:18 +01:00
parent 3256259a39
commit 5088beedc5
1 changed files with 34 additions and 19 deletions

View File

@ -1082,6 +1082,19 @@ function graphic_combined_module ($module_list, $weight_list, $period,
$graph_values = array(); $graph_values = array();
$module_name_list = array(); $module_name_list = array();
$collector = 0; $collector = 0;
$user = users_get_user_by_id($config['id_user']);
$user_flash_charts = $user['flash_chart'];
if ($user_flash_charts == 1)
$flash_charts = true;
elseif($user_flash_charts == -1)
$flash_charts = $config['flash_charts'];
elseif($user_flash_charts == 0)
$flash_charts = false;
if ($only_image) {
$flash_charts = false;
}
// Calculate data for each module // Calculate data for each module
for ($i = 0; $i < $module_number; $i++) { for ($i = 0; $i < $module_number; $i++) {
@ -1196,7 +1209,10 @@ function graphic_combined_module ($module_list, $weight_list, $period,
$module_name = io_safe_output( $module_name = io_safe_output(
modules_get_agentmodule_name ($agent_module_id)); modules_get_agentmodule_name ($agent_module_id));
if ($flash_charts)
$module_name_list[$i] = '<span style=\"font-size:' . ($config['font_size']) . 'pt;font-family: smallfontFont;\" >' . $agent_name . " / " . $module_name. '</span>'; $module_name_list[$i] = '<span style=\"font-size:' . ($config['font_size']) . 'pt;font-family: smallfontFont;\" >' . $agent_name . " / " . $module_name. '</span>';
else
$module_name_list[$i] = $agent_name . " / " . $module_name;
} }
} }
else { else {
@ -1213,10 +1229,22 @@ function graphic_combined_module ($module_list, $weight_list, $period,
$module_name = sprintf(__("%s"), $module_name); $module_name = sprintf(__("%s"), $module_name);
$module_name = ui_print_truncate_text($module_name, 'module_small', false, true, false, '...', false); $module_name = ui_print_truncate_text($module_name, 'module_small', false, true, false, '...', false);
if ($flash_charts) {
if ($labels[$agent_module_id] != '') if ($labels[$agent_module_id] != '')
$module_name_list[$i] = '<span style=\"font-size:' . ($config['font_size']) . 'pt;font-family: smallfontFont;\" >' . $labels[$agent_module_id] . '</span>'; $module_name_list[$i] = '<span style=\"font-size:' .
($config['font_size']) . 'pt;font-family: smallfontFont;\" >' .
$labels[$agent_module_id] . '</span>';
else else
$module_name_list[$i] = '<span style=\"font-size:' . ($config['font_size']) . 'pt;font-family: smallfontFont;\" >' . $agent_name . ' / ' . $module_name . '</span>'; $module_name_list[$i] = '<span style=\"font-size:' .
($config['font_size']) . 'pt;font-family: smallfontFont;\" >' .
$agent_name . ' / ' . $module_name . '</span>';
}
else {
if ($labels[$agent_module_id] != '')
$module_name_list[$i] = $labels[$agent_module_id];
else
$module_name_list[$i] = $agent_name . ' / ' . $module_name;
}
} }
// Data iterator // Data iterator
@ -1413,19 +1441,6 @@ function graphic_combined_module ($module_list, $weight_list, $period,
} }
$temp = array(); $temp = array();
$user = users_get_user_by_id($config['id_user']);
$user_flash_charts = $user['flash_chart'];
if ($user_flash_charts == 1)
$flash_charts = true;
elseif($user_flash_charts == -1)
$flash_charts = $config['flash_charts'];
elseif($user_flash_charts == 0)
$flash_charts = false;
if ($only_image) {
$flash_charts = false;
}
if ($flash_charts === false && $stacked == CUSTOM_GRAPH_GAUGE) if ($flash_charts === false && $stacked == CUSTOM_GRAPH_GAUGE)
$stacked = CUSTOM_GRAPH_BULLET_CHART; $stacked = CUSTOM_GRAPH_BULLET_CHART;