2009-05-27 Esteban Sanchez <estebans@artica.es>

* reporting/fgraph.php: Do not short agent name on
	graphic_combined_module(). It was causing collisions. Fixes #2785193.

	* reporting/pchart_graph.php: Use AddSerie on combined_graph().



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1710 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
esanchezm 2009-05-27 10:06:33 +00:00
parent f4d073dc3d
commit 939e9be40c
3 changed files with 18 additions and 12 deletions

View File

@ -1,3 +1,10 @@
2009-05-27 Esteban Sanchez <estebans@artica.es>
* reporting/fgraph.php: Do not short agent name on
graphic_combined_module(). It was causing collisions. Fixes #2785193.
* reporting/pchart_graph.php: Use AddSerie on combined_graph().
2009-05-27 Esteban Sanchez <estebans@artica.es>
* include/functions_visual_map.php: Problem fixed on

View File

@ -121,10 +121,9 @@ function graphic_combined_module ($module_list, $weight_list, $period, $width, $
// FOR EACH MODULE IN module_list....
for ($i = 0; $i < $module_number; $i++) {
$id_agente_modulo = $module_list[$i];
$nombre_agente = get_agentmodule_agent_name ($id_agente_modulo);
$id_agente = get_agent_id ($nombre_agente);
$nombre_modulo = get_agentmodule_name ($id_agente_modulo);
$module_list_name[$i] = substr ($nombre_agente, 0, 9)." / ".substr ($nombre_modulo, 0, 20);
$agent_name = get_agentmodule_agent_name ($id_agente_modulo);
$module_name = get_agentmodule_name ($id_agente_modulo);
$module_list_name[$i] = $agent_name." / ".substr ($module_name, 0, 20);
for ($j = 0; $j <= $resolution; $j++) {
$data[$j]['sum'] = 0; // SUM of all values for this interval
$data[$j]['count'] = 0; // counter
@ -134,8 +133,8 @@ function graphic_combined_module ($module_list, $weight_list, $period, $width, $
$data[$j]['max'] = 0; // MAX
$data[$j]['events'] = 0; // Event
}
// Init other general variables
if ($show_event == 1) {
// If we want to show events in graphs
$sql = "SELECT utimestamp FROM tevento WHERE id_agentmodule = $id_agente_modulo AND utimestamp > $datelimit";
@ -215,7 +214,7 @@ function graphic_combined_module ($module_list, $weight_list, $period, $width, $
$data[$j]['max'] = $previous;
}
// Get max value for all graph
if ($data[$j]['max'] > $max_value ){
if ($data[$j]['max'] > $max_value) {
$max_value = $data[$j]['max'];
}
// This stores in mod_data max values for each module
@ -254,13 +253,12 @@ function graphic_combined_module ($module_list, $weight_list, $period, $width, $
$engine->width = $width;
$engine->height = $height;
$engine->data = &$real_data;
$engine->legend = &$legend;
$engine->legend = $module_list_name;
$engine->fontpath = $config['fontpath'];
$engine->title = ' '.strtoupper ($nombre_agente)." - ".__('Module').' '.$title;
$engine->subtitle = ' '.__('Period').': '.$title_period;
$engine->show_title = !$pure;
$engine->stacked = $stacked;
$engine->legend = $module_list_name;
$engine->xaxis_interval = $resolution;
$events = $show_event ? $real_event : false;
$alerts = $show_alert ? array ('low' => $alert_low, 'high' => $alert_high) : false;
@ -955,8 +953,7 @@ function grafico_modulo_boolean ($id_agente_modulo, $period, $show_event,
$max_value = 0;
$all_data = get_db_all_rows_filter ('tagente_datos',
array ('id_agente' => $id_agente,
'id_agente_modulo' => $id_agente_modulo,
array ('id_agente_modulo' => $id_agente_modulo,
"utimestamp > $datelimit",
"utimestamp < $date",
'order' => 'utimestamp ASC'),

View File

@ -264,8 +264,10 @@ class PchartGraph extends PandoraGraphAbstract {
}
}
foreach ($this->legend as $name)
$this->dataset->setSerieName($name, $name);
foreach ($this->legend as $name) {
$this->dataset->setSerieName ($name, $name);
$this->dataset->AddSerie ($name);
}
$this->set_colors ();
$this->graph->setFontProperties ($this->fontpath, 8);