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:
parent
768fd43524
commit
fca081ab21
|
@ -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.
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
*
|
||||
|
|
|
@ -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&sec2=operation/agentes/ver_agente&id_agente='.$layout_data["id_agent"].'&tab=data">';
|
||||
echo '<div style="border-width:1px; border-style:solid; border-color:#808080"><a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$layout_data["id_agent"].'&tab=data">';
|
||||
} else {
|
||||
echo '<a href="index.php?sec=visualc&sec2=operation/visual_console/render_view&pure='.$config["pure"].'&id='.$layout_data['id_layout_linked'].'">';
|
||||
echo '<div style="border-width:1px; border-style:solid; border-color:#808080"><a href="index.php?sec=visualc&sec2=operation/visual_console/render_view&pure='.$config["pure"].'&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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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 ();
|
||||
|
||||
|
|
Loading…
Reference in New Issue