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

* include/pchart_graph.php
	* include/functions_visual_map.php: Removed blank spaces when graphs are resized 
	in Visual console.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3738 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
juanmanuelr 2011-01-12 17:08:50 +00:00
parent 6096c230f8
commit 9badf2b455
3 changed files with 21 additions and 11 deletions

View File

@ -1,3 +1,9 @@
2010-01-12 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/pchart_graph.php
* include/functions_visual_map.php: Removed blank spaces when graphs are resized
in Visual console.
2010-01-12 Juan Manuel Ramon <juanmanuel.ramon@artica.es> 2010-01-12 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_visual_map.php: Changed the way of create marks * include/functions_visual_map.php: Changed the way of create marks

View File

@ -104,11 +104,11 @@ function printItemInVisualConsole($layoutData) {
break; break;
case MODULE_GRAPH: case MODULE_GRAPH:
$img = '<img class="image" id="image_' . $id . '" src="include/fgraph.php?tipo=sparse&id=' . $id_module . '&label=' . $label . '&height=' . $height . '&pure=1&width=' . $width . '&period=' . $period . '" />'; $img = '<img class="image" id="image_' . $id . '" src="include/fgraph.php?tipo=sparse&id=' . $id_module . '&label=' . base64_encode ($label) . '&height=' . $height . '&pure=1&width=' . $width . '&period=' . $period . ' " style="border:1px solid #808080;" />';
echo '<div id="' . $id . '" class="item module_graph" style="color: ' . $color . '; text-align: center; position: absolute; ' . $sizeStyle . ' margin-top: ' . $top . 'px; margin-left: ' . $left . 'px;">'; echo '<div id="' . $id . '" class="item module_graph" style="color: ' . $color . '; text-align: center; position: absolute; ' . $sizeStyle . ' margin-top: ' . $top . 'px; margin-left: ' . $left . 'px;">';
echo $text . '<br />'; echo $text . '<br />';
echo '<table style="border:1px solid #808080;"><tr><td>' . $img . '</td></tr></table>'; echo $img;
echo '</div>'; echo '</div>';
break; break;
case SIMPLE_VALUE: case SIMPLE_VALUE:
@ -739,9 +739,9 @@ function print_pandora_visual_map ($id_layout, $show_links = true, $draw_lines =
if ($show_links) { if ($show_links) {
if (($layout_data['id_layout_linked'] == "") || ($layout_data['id_layout_linked'] == 0)) { if (($layout_data['id_layout_linked'] == "") || ($layout_data['id_layout_linked'] == 0)) {
echo '<table style="border:1px solid #808080;"><tr><td><a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$layout_data["id_agent"].'&amp;tab=data">'; echo '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$layout_data["id_agent"].'&amp;tab=data">';
} else { } else {
echo '<table style="border:1px solid #808080;"><tr><td><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 '<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) if ($resizedMap)
@ -749,10 +749,10 @@ function print_pandora_visual_map ($id_layout, $show_links = true, $draw_lines =
// ATTENTION: DO NOT USE &amp; here because is bad-translated and doesnt work // ATTENTION: DO NOT USE &amp; here because is bad-translated and doesnt work
// resulting fault image links :( // resulting fault image links :(
print_image ("include/fgraph.php?tipo=sparse&id=".$layout_data['id_agente_modulo']."&label=". base64_encode ($layout_data['label'])."&height=".((integer)($proportion * $layout_data['height']))."&pure=1&width=".((integer)($proportion * $layout_data['width']))."&period=".$layout_data['period'], false, array ("title" => $layout_data['label'], "border" => 0)); print_image ("include/fgraph.php?tipo=sparse&id=".$layout_data['id_agente_modulo']."&label=". base64_encode ($layout_data['label'])."&height=".((integer)($proportion * $layout_data['height']))."&pure=1&width=".((integer)($proportion * $layout_data['width']))."&period=".$layout_data['period'], false, array ("title" => $layout_data['label'], "border" => 0, "style" => "border:1px solid #808080;"));
else else
print_image ("include/fgraph.php?tipo=sparse&id=".$layout_data['id_agente_modulo']."&label=". base64_encode ($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)); print_image ("include/fgraph.php?tipo=sparse&id=".$layout_data['id_agente_modulo']."&label=". base64_encode ($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, "style" => "border:1px solid #808080;"));
echo "</a></tr></td></table>"; echo "</a>";
echo "</div>"; echo "</div>";
break; break;
} }

View File

@ -213,13 +213,17 @@ class PchartGraph extends PandoraGraphAbstract {
} }
// White background // White background
$this->graph->drawFilledRoundedRectangle(1,1,$this->width,$this->height,0,254,254,254); $this->graph->drawFilledRoundedRectangle(1,1,$this->width,$this->height+2,0,254,254,254);
// Graph border // Graph border
$this->graph->drawRoundedRectangle(1,1,$this->width-1,$this->height+4,5,230,230,230); // Now graph border is in the style image attribute
//$this->graph->drawRoundedRectangle(1,1,$this->width-1,$this->height+4,5,230,230,230);
$this->add_background (); $this->add_background ();
// If graph is small remove blank spaces
if ($this->width < MIN_WIDTH || $this->height < MIN_HEIGHT)
$this->graph->setGraphArea (5,5,$this->width-5,$this->height-5);
$this->graph->drawGraphArea (254, 254, 254, false); $this->graph->drawGraphArea (254, 254, 254, false);
$this->xaxis_interval = ($this->xaxis_interval / 7 >= 1) ? ($this->xaxis_interval / 7) : 10; $this->xaxis_interval = ($this->xaxis_interval / 7 >= 1) ? ($this->xaxis_interval / 7) : 10;
@ -233,7 +237,7 @@ class PchartGraph extends PandoraGraphAbstract {
}else{ }else{
$this->graph->drawScale ($this->dataset->GetData (), $this->graph->drawScale ($this->dataset->GetData (),
$this->dataset->GetDataDescription (), SCALE_START0, $this->dataset->GetDataDescription (), SCALE_START0,
80, 80, 80, "", 0, 50, false, 80, 80, 80, false, 0, 50, false,
$this->xaxis_interval); $this->xaxis_interval);
} }