2010-01-10 Juan Manuel Ramon <juanmanuel.ramon@artica.es>

* pchart_graph.php: Remove axis values and legend in small graphs.
	* functions_visual_map.php: Added marks (div borders) for beautify visual console graphs.
	* fgraph.php: Dont show caption graphs in small graphs.
	* functions.php: Added constants for visual console.

	Fixes bug #3152673.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3730 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
juanmanuelr 2011-01-10 18:33:26 +00:00
parent 768fd43524
commit fca081ab21
5 changed files with 38 additions and 8 deletions

View File

@ -1,3 +1,12 @@
2010-01-10 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* pchart_graph.php: Remove axis values and legend in small graphs.
* functions_visual_map.php: Added marks (div borders) for beautify visual console graphs.
* fgraph.php: Dont show caption graphs in small graphs.
* functions.php: Added constants for visual console.
Fixes bug #3152673.
2010-01-07 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* pandora_console_upgrade: Changed permissions in this file to make it executable by default.

View File

@ -1381,8 +1381,13 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
$time_format = 'M j';
}
// Only show caption if graph is not small
if ($width > MIN_WIDTH_CAPTION && $height > MIN_HEIGHT)
// Flash chart
$caption = __('Max. Value') . ': ' . $max_value . ' ' . __('Avg. Value') . ': ' . $avg_value . ' ' . __('Min. Value') . ': ' . $min_value;
else
$caption = array();
if (! $graphic_type) {
return fs_module_chart ($chart, $width, $height, $avg_only, $resolution / 10, $time_format, $show_events, $show_alerts, $caption, $baseline);
}

View File

@ -36,6 +36,11 @@ define ('EVENT_PROCESS', 2);
define ('AGENT_ENABLED',0);
define ('AGENT_DISABLED',1);
/* Visual console constants */
define("MIN_WIDTH",300);
define("MIN_HEIGHT",120);
define("MIN_WIDTH_CAPTION",420);
/**
* Cleans an object or an array and casts all values as integers
*

View File

@ -739,9 +739,9 @@ function print_pandora_visual_map ($id_layout, $show_links = true, $draw_lines =
if ($show_links) {
if (($layout_data['id_layout_linked'] == "") || ($layout_data['id_layout_linked'] == 0)) {
echo '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$layout_data["id_agent"].'&amp;tab=data">';
echo '<div style="border-width:1px; border-style:solid; border-color:#808080"><a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$layout_data["id_agent"].'&amp;tab=data">';
} else {
echo '<a href="index.php?sec=visualc&amp;sec2=operation/visual_console/render_view&amp;pure='.$config["pure"].'&amp;id='.$layout_data['id_layout_linked'].'">';
echo '<div style="border-width:1px; border-style:solid; border-color:#808080"><a href="index.php?sec=visualc&amp;sec2=operation/visual_console/render_view&amp;pure='.$config["pure"].'&amp;id='.$layout_data['id_layout_linked'].'">';
}
}
if ($resizedMap)
@ -753,7 +753,7 @@ function print_pandora_visual_map ($id_layout, $show_links = true, $draw_lines =
else
print_image ("include/fgraph.php?tipo=sparse&id=".$layout_data['id_agente_modulo']."&label=".safe_input ($layout_data['label'])."&height=".$layout_data['height']."&pure=1&width=".$layout_data['width']."&period=".$layout_data['period'], false, array ("title" => $layout_data['label'], "border" => 0));
echo "</a>";
echo "</div>";
echo "</div></div>";
break;
}

View File

@ -223,10 +223,19 @@ class PchartGraph extends PandoraGraphAbstract {
$this->graph->drawGraphArea (254, 254, 254, false);
$this->xaxis_interval = ($this->xaxis_interval / 7 >= 1) ? ($this->xaxis_interval / 7) : 10;
$this->graph->drawScale ($this->dataset->GetData (),
$this->dataset->GetDataDescription (), SCALE_START0,
80, 80, 80, $this->show_axis, 0, 50, false,
$this->xaxis_interval);
// Remove axis values if graph is small
if ($this->width > MIN_WIDTH && $this->height > MIN_HEIGHT){
$this->graph->drawScale ($this->dataset->GetData (),
$this->dataset->GetDataDescription (), SCALE_START0,
80, 80, 80, $this->show_axis, 0, 50, false,
$this->xaxis_interval);
}else{
$this->graph->drawScale ($this->dataset->GetData (),
$this->dataset->GetDataDescription (), SCALE_START0,
80, 80, 80, "", 0, 50, false,
$this->xaxis_interval);
}
/* NOTICE: The final "false" is a Pandora modificaton of pChart to avoid showing vertical lines. */
if ($this->show_grid)
@ -235,7 +244,9 @@ class PchartGraph extends PandoraGraphAbstract {
// Draw the graph
$this->graph->drawFilledLineGraph ($this->dataset->GetData(), $this->dataset->GetDataDescription(), 50, true);
$this->add_legend ();
// Remove legends if graph is small
if ($this->width > MIN_WIDTH && $this->height > MIN_HEIGHT)
$this->add_legend ();
$this->add_events ("AVG");
$this->add_alert_levels ();