From 619b30004f01c053d9c9b34f7df029998fec21a4 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Mon, 2 Aug 2010 14:38:52 +0000 Subject: [PATCH] 2010-08-02 Ramon Novoa * include/pchart_graph.php, include/fgraph.php: Removed title from image charts. Show min, max and avg as part of the image. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3085 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++ pandora_console/include/fgraph.php | 41 +++++++++--------------- pandora_console/include/pchart_graph.php | 4 +-- 3 files changed, 22 insertions(+), 28 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index fb1f437636..4a13867639 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2010-08-02 Ramon Novoa + + * include/pchart_graph.php, include/fgraph.php: Removed title from + image charts. Show min, max and avg as part of the image. + 2010-08-02 Ramon Novoa * include/functions_reporting.php, include/fgraph.php, diff --git a/pandora_console/include/fgraph.php b/pandora_console/include/fgraph.php index db36b3a7f2..ae0529311c 100644 --- a/pandora_console/include/fgraph.php +++ b/pandora_console/include/fgraph.php @@ -26,6 +26,7 @@ if (isset($config)) { require_once ($config['homedir'].'/include/config.php'); require_once ($config['homedir'].'/include/pandora_graph.php'); require_once ($config['homedir'].'/include/functions_fsgraph.php'); + require_once ($config['homedir'].'/include/functions_reporting.php'); /**#@-*/ } else { @@ -34,6 +35,7 @@ else { */ require_once ('../include/config.php'); require_once ($config['homedir'].'/include/pandora_graph.php'); + require_once ($config['homedir'].'/include/functions_reporting.php'); /**#@-*/ } @@ -231,13 +233,9 @@ function graphic_combined_module ($module_list, $weight_list, $period, $width, $ $graph_values[$i] = array(); if ($data[0]['utimestamp'] == $datelimit) { $previous_data = $data[0]['datos']; - $min_value = $data[0]['datos']; - $max_value = $data[0]['datos']; $j++; } else { $previous_data = 0; - $min_value = 0; - $max_value = 0; } // Calculate chart data @@ -266,13 +264,6 @@ function graphic_combined_module ($module_list, $weight_list, $period, $width, $ $total /= $count; } - // Min and max - if ($interval_max > $max_value) { - $max_value = $interval_max; - } else if ($interval_min < $min_value) { - $min_value = $interval_min; - } - // Read events and alerts that fall in the current interval $event_value = 0; $alert_value = 0; @@ -335,7 +326,7 @@ function graphic_combined_module ($module_list, $weight_list, $period, $width, $ $engine->legend = $module_name_list; $engine->fontpath = $config['fontpath']; $engine->title = ""; - $engine->subtitle = ' '.__('Period').': '.$title_period; + $engine->subtitle = ""; $engine->show_title = !$pure; $engine->stacked = $stacked; $engine->xaxis_interval = $resolution; @@ -1483,8 +1474,8 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events, } // Flash chart + $caption = __('Max. Value') . ': ' . $min_value . ' ' . __('Avg. Value') . ': ' . $avg_value . ' ' . __('Min. Value') . ': ' . $min_value; if (! $graphic_type) { - $caption = __('Max. Value') . ': ' . $min_value . ' ' . __('Avg. Value') . ': ' . $avg_value . ' ' . __('Min. Value') . ': ' . $min_value; return fs_module_chart ($chart, $width, $height, $avg_only, $resolution / 10, $time_format, $show_events, $show_alerts, $caption); } @@ -1493,11 +1484,9 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events, $engine->height = $height; $engine->data = &$chart; $engine->xaxis_interval = $resolution; - if ($title == '') - $title = get_agentmodule_name ($id_agente_modulo); - $engine->title = ' '.strtoupper ($nombre_agente)." - ".__('Module').' '.$title; - $engine->subtitle = ' '.__('Period').': '.$title_period; - $engine->show_title = !$pure; + $engine->title = ""; + $engine->subtitle = $caption; + $engine->show_title = true; $engine->max_value = $max_value; $engine->min_value = $min_value; $engine->events = (bool) $show_event; @@ -1722,8 +1711,8 @@ function grafico_modulo_boolean ($agent_module_id, $period, $show_events, } // Flash chart + $caption = __('Max. Value') . ': ' . $max_value . ' ' . __('Avg. Value') . ': ' . $avg_value . ' ' . __('Min. Value') . ': ' . $min_value; if (! $graphic_type) { - $caption = __('Max. Value') . ': ' . $max_value . ' ' . __('Avg. Value') . ': ' . $avg_value . ' ' . __('Min. Value') . ': ' . $min_value; return fs_module_chart ($chart, $width, $height, $avg_only, $resolution / 10, $time_format, $show_events, $show_alerts, $caption); } @@ -1740,9 +1729,9 @@ function grafico_modulo_boolean ($agent_module_id, $period, $show_events, $engine->data = &$chart_data; $engine->max_value = 1; $engine->legend = array ($module_name); - $engine->title = ' '.strtoupper ($agent_name)." - ".__('Module').' '.$title; - $engine->subtitle = ' '.__('Period').': '.$title_period; - $engine->show_title = !$pure; + $engine->title = ""; + $engine->subtitle = $caption; + $engine->show_title = true; $engine->events = false; $engine->fontpath = $config['fontpath']; $engine->alert_top = false; @@ -1947,8 +1936,8 @@ function grafico_modulo_string ($agent_module_id, $period, $show_events, } // Flash chart + $caption = __('Max. Value') . ': ' . $min_value . ' ' . __('Avg. Value') . ': ' . $avg_value . ' ' . __('Min. Value') . ': ' . $min_value; if (! $graphic_type) { - $caption = __('Max. Value') . ': ' . $min_value . ' ' . __('Avg. Value') . ': ' . $avg_value . ' ' . __('Min. Value') . ': ' . $min_value; return fs_module_chart ($chart, $width, $height, $avg_only, $resolution / 10, $time_format, $show_events, $show_alerts, $caption); } @@ -1966,9 +1955,9 @@ function grafico_modulo_string ($agent_module_id, $period, $show_events, $engine->max_value = max ($chart_data); $engine->legend = array ($module_name); - $engine->title = ' '.strtoupper ($agent_name)." - ".__('Module').' '.$title; - $engine->subtitle = ' '.__('Period').': '.$title_period; - $engine->show_title = !$pure; + $engine->title = ""; + $engine->subtitle = $caption; + $engine->show_title = true; $engine->events = false; $engine->fontpath = $config['fontpath']; $engine->alert_top = false; diff --git a/pandora_console/include/pchart_graph.php b/pandora_console/include/pchart_graph.php index 93b182a46c..cf41df5c3f 100644 --- a/pandora_console/include/pchart_graph.php +++ b/pandora_console/include/pchart_graph.php @@ -539,8 +539,8 @@ class PchartGraph extends PandoraGraphAbstract { $this->graph->setFontProperties ($this->fontpath, 12); $this->graph->drawTextBox (2, 7, $this->width, 20, $this->title, 0, 0, 0, 0, ALIGN_LEFT, false); $this->graph->setFontProperties ($this->fontpath, 9); - $this->graph->drawTextBox ($this->width-150, 10, $this->width, 20, $this->subtitle, - 0, 0, 0, 0, ALIGN_LEFT, false); + $this->graph->drawTextBox (0, 10, $this->width, 20, $this->subtitle, + 0, 0, 0, 0, ALIGN_CENTER, false); $this->graph->setFontProperties ($this->fontpath, 6); }