From faa2f19a821982fbf1d5729e347e3237cedc740e Mon Sep 17 00:00:00 2001 From: juanmanuelr Date: Wed, 12 Jan 2011 17:08:50 +0000 Subject: [PATCH] 2010-01-12 Juan Manuel Ramon * 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 --- pandora_console/ChangeLog | 6 ++++++ pandora_console/include/functions_visual_map.php | 14 +++++++------- pandora_console/include/pchart_graph.php | 12 ++++++++---- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 77a985f6af..be6569fe82 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2010-01-12 Juan Manuel Ramon + + * 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 * include/functions_visual_map.php: Changed the way of create marks diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index 927ee4fb48..58d344e0cf 100644 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -104,11 +104,11 @@ function printItemInVisualConsole($layoutData) { break; case MODULE_GRAPH: - $img = ''; + $img = ''; echo '
'; echo $text . '
'; - echo '
' . $img . '
'; + echo $img; echo '
'; break; case SIMPLE_VALUE: @@ -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 '
'; + echo ''; } else { - echo '
'; + echo ''; } } if ($resizedMap) @@ -749,10 +749,10 @@ function print_pandora_visual_map ($id_layout, $show_links = true, $draw_lines = // ATTENTION: DO NOT USE & here because is bad-translated and doesnt work // 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 - 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)); - echo "
"; + 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 "
"; echo ""; break; } diff --git a/pandora_console/include/pchart_graph.php b/pandora_console/include/pchart_graph.php index 05ac4184b9..3ff45c6e6a 100644 --- a/pandora_console/include/pchart_graph.php +++ b/pandora_console/include/pchart_graph.php @@ -213,13 +213,17 @@ class PchartGraph extends PandoraGraphAbstract { } // 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 - $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->xaxis_interval = ($this->xaxis_interval / 7 >= 1) ? ($this->xaxis_interval / 7) : 10; @@ -233,7 +237,7 @@ class PchartGraph extends PandoraGraphAbstract { }else{ $this->graph->drawScale ($this->dataset->GetData (), $this->dataset->GetDataDescription (), SCALE_START0, - 80, 80, 80, "", 0, 50, false, + 80, 80, 80, false, 0, 50, false, $this->xaxis_interval); }