2011-06-27 Vanessa Gil <vanessa.gil@artica.es>
* include/functions_graph.php: Display units in the legend of module graph. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4489 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
0160bf4ff6
commit
6eb156ae54
|
@ -1,3 +1,7 @@
|
||||||
|
2011-06-27 Vanessa Gil <vanessa.gil@artica.es>
|
||||||
|
|
||||||
|
* include/functions_graph.php: Display units in the legend of module graph.
|
||||||
|
|
||||||
2011-06-27 Sancho Lerena <slerena@artica.es>
|
2011-06-27 Sancho Lerena <slerena@artica.es>
|
||||||
|
|
||||||
* include/functions_config.php: Added a new function to do global
|
* include/functions_config.php: Added a new function to do global
|
||||||
|
|
|
@ -244,6 +244,8 @@ function grafico_modulo_sparse2 ($agent_module_id, $period, $show_events,
|
||||||
if ($chart[$timestamp]['baseline'] == NULL) {
|
if ($chart[$timestamp]['baseline'] == NULL) {
|
||||||
$chart[$timestamp]['baseline'] = 0;
|
$chart[$timestamp]['baseline'] = 0;
|
||||||
}
|
}
|
||||||
|
$units = modules_get_unit($agent_module_id);
|
||||||
|
$chart[$timestamp]['unit'] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return chart data and don't draw
|
// Return chart data and don't draw
|
||||||
|
@ -270,7 +272,7 @@ function grafico_modulo_sparse2 ($agent_module_id, $period, $show_events,
|
||||||
// Only show caption if graph is not small
|
// Only show caption if graph is not small
|
||||||
if ($width > MIN_WIDTH_CAPTION && $height > MIN_HEIGHT)
|
if ($width > MIN_WIDTH_CAPTION && $height > MIN_HEIGHT)
|
||||||
//Flash chart
|
//Flash chart
|
||||||
$caption = __('Max. Value') . ': ' . $max_value . ' ' . __('Avg. Value') . ': ' . $avg_value . ' ' . __('Min. Value') . ': ' . $min_value;
|
$caption = __('Max. Value') . ': ' . $max_value . ' ' . __('Avg. Value') . ': ' . $avg_value . ' ' . __('Min. Value') . ': ' . $min_value . ' ' . __('Units. Value') . ': ' . $units;
|
||||||
else
|
else
|
||||||
$caption = array();
|
$caption = array();
|
||||||
|
|
||||||
|
@ -286,6 +288,7 @@ function grafico_modulo_sparse2 ($agent_module_id, $period, $show_events,
|
||||||
$color['max'] = array('border' => '#000000', 'color' => $config['graph_color3'], 'alpha' => 50);
|
$color['max'] = array('border' => '#000000', 'color' => $config['graph_color3'], 'alpha' => 50);
|
||||||
$color['min'] = array('border' => '#000000', 'color' => $config['graph_color1'], 'alpha' => 50);
|
$color['min'] = array('border' => '#000000', 'color' => $config['graph_color1'], 'alpha' => 50);
|
||||||
$color['baseline'] = array('border' => null, 'color' => '#0097BD', 'alpha' => 10);
|
$color['baseline'] = array('border' => null, 'color' => '#0097BD', 'alpha' => 10);
|
||||||
|
$color['unit'] = array('border' => null, 'color' => '#0097BC', 'alpha' => 10);
|
||||||
|
|
||||||
$legend = array();
|
$legend = array();
|
||||||
$legend['sum'] = __('Avg') . ' (' . $avg_value . ')';
|
$legend['sum'] = __('Avg') . ' (' . $avg_value . ')';
|
||||||
|
@ -298,6 +301,7 @@ function grafico_modulo_sparse2 ($agent_module_id, $period, $show_events,
|
||||||
$legend['max'] = __('Max') . ' (' .format_for_graph($max_value) . ')';
|
$legend['max'] = __('Max') . ' (' .format_for_graph($max_value) . ')';
|
||||||
$legend['min'] = __('Min') . ' (' . format_for_graph($min_value) . ')';
|
$legend['min'] = __('Min') . ' (' . format_for_graph($min_value) . ')';
|
||||||
$legend['baseline'] = __('Baseline');
|
$legend['baseline'] = __('Baseline');
|
||||||
|
$legend['unit'] = __('Units'). ' (' . $units . ')';
|
||||||
|
|
||||||
$flash_chart = $config['flash_charts'];
|
$flash_chart = $config['flash_charts'];
|
||||||
if ($only_image) {
|
if ($only_image) {
|
||||||
|
@ -587,8 +591,9 @@ function graphic_combined_module2 ($module_list, $weight_list, $period, $width,
|
||||||
$min = format_for_graph($min);
|
$min = format_for_graph($min);
|
||||||
$max = format_for_graph($max);
|
$max = format_for_graph($max);
|
||||||
$avg = format_for_graph($avg);
|
$avg = format_for_graph($avg);
|
||||||
|
$units = modules_get_unit($agent_module_id);
|
||||||
|
|
||||||
$module_name_list[$i] .= " (".__("Max"). ":$max, ".__("Min"). ":$min, ". __("Avg"). ": $avg)";
|
$module_name_list[$i] .= " (".__("Max"). ":$max, ".__("Min"). ":$min, ". __("Avg"). ": $avg, ". __("Units"). ": $units)";
|
||||||
|
|
||||||
if ($weight_list[$i] != 1) {
|
if ($weight_list[$i] != 1) {
|
||||||
//$module_name_list[$i] .= " (x". format_numeric ($weight_list[$i], 1).")";
|
//$module_name_list[$i] .= " (x". format_numeric ($weight_list[$i], 1).")";
|
||||||
|
@ -1985,6 +1990,7 @@ function grafico_modulo_string2 ($agent_module_id, $period, $show_events,
|
||||||
$min_value = round(reporting_get_agentmodule_data_min ($agent_module_id, $period, $date), 2);
|
$min_value = round(reporting_get_agentmodule_data_min ($agent_module_id, $period, $date), 2);
|
||||||
$max_value = round(reporting_get_agentmodule_data_max ($agent_module_id, $period, $date), 2);
|
$max_value = round(reporting_get_agentmodule_data_max ($agent_module_id, $period, $date), 2);
|
||||||
$avg_value = round(reporting_get_agentmodule_data_average ($agent_module_id, $period, $date), 2);
|
$avg_value = round(reporting_get_agentmodule_data_average ($agent_module_id, $period, $date), 2);
|
||||||
|
$unit = modules_get_unit($agent_module_id);
|
||||||
|
|
||||||
// Fix event and alert scale
|
// Fix event and alert scale
|
||||||
$event_max = $max_value * 1.25;
|
$event_max = $max_value * 1.25;
|
||||||
|
|
Loading…
Reference in New Issue