From 9926f1886cad61ddd622978a55d2c7909460e733 Mon Sep 17 00:00:00 2001 From: Manuel Nazar Anchorena Date: Mon, 26 Jan 2004 15:22:10 +0000 Subject: [PATCH] Se emprolijo el codigo --- lib/MECON/Graph.php | 94 +++++++++------------- test/Marco/prueba/www/images/perfiles.gif | Bin 618 -> 567 bytes 2 files changed, 36 insertions(+), 58 deletions(-) diff --git a/lib/MECON/Graph.php b/lib/MECON/Graph.php index e1817fa..f1957fa 100644 --- a/lib/MECON/Graph.php +++ b/lib/MECON/Graph.php @@ -165,17 +165,6 @@ class MECON_Graph { require_once 'MECON/Graph/external/jpgraph/src/jpgraph_line.php'; $plot= new LinePlot($secuencia); - if (isset($atributos['formatoValores'])) - $plot->value->format = $atributos['formatoValores']; - - if ($this->_verValores) - $plot->value->Show(); - - if (isset($atributos['colorRelleno'])) - { - $plot->SetFillColor($atributos['colorRelleno']); - } - } @@ -185,17 +174,6 @@ class MECON_Graph { require_once 'MECON/Graph/external/jpgraph/src/jpgraph_bar.php'; $plot= new BarPlot($secuencia); - if (isset($atributos['formatoValores'])) - $plot->value->format = $atributos['formatoValores']; - - if ($this->_verValores) - $plot->value->Show(); - - if (isset($atributos['colorRelleno'])) - { - $plot->SetFillColor($atributos['colorRelleno']); - } - } if ($tipo=="puntos") @@ -204,19 +182,8 @@ class MECON_Graph { require_once 'MECON/Graph/external/jpgraph/src/jpgraph_scatter.php'; $plot= new ScatterPlot($secuencia); - if (isset($atributos['formatoValores'])) - $plot->value->format = $atributos['formatoValores']; - - if ($this->_verValores) - $plot->value->Show(); - - if (isset($atributos['colorRelleno'])){ - $plot->mark->SetFillColor($atributos['colorRelleno']); - } - - if (isset($atributos['tipoMarca'])){ - $plot->mark->SetType($atributos['tipoMarca']); - } + if (isset($atributos['tipoMarca'])) + $plot->mark->SetType($atributos['tipoMarca']); if (isset($atributos['impulso'])) { @@ -224,22 +191,31 @@ class MECON_Graph { $plot->SetImpuls(); } } - - // Seteo opciones generales - if (isset($atributos['color'])) - { - $plot->SetColor($atributos['color']); - } - if (isset($atributos['leyenda'])) + + //Si hubo error + if ($valido==true) { - $plot->SetLegend($atributos['leyenda']); - //$this->_grafico->legend->SetLayout(LEGEND_HOR); - $this->_grafico->legend->Pos(0.02,0.01); - } + + // Seteo opciones generales + if (isset($atributos['formatoValores'])) + $plot->value->format = $atributos['formatoValores']; + if ($this->_verValores) + $plot->value->Show(); + + if (isset($atributos['colorRelleno'])) + $plot->SetFillColor($atributos['colorRelleno']); + + if (isset($atributos['color'])) + $plot->SetColor($atributos['color']); + if (isset($atributos['leyenda'])) + { + $plot->SetLegend($atributos['leyenda']); + //$this->_grafico->legend->SetLayout(LEGEND_HOR); + $this->_grafico->legend->Pos(0.02,0.01); + } - //Si hubo error - if ($valido==false) + }else { die ("Error: Tipo de grafico $tipo no valido (aun)"); } @@ -254,8 +230,8 @@ class MECON_Graph { if($this->_tipo=="torta3D") $plot= new PiePlot3D($secuencia); - // Esto lo agrego porque si no, no redondea a 100% - $plot->labeltype = 2; + // Esto lo agrego porque si no, no redondea a 100% + $plot->labeltype = 2; if ($this->_verValores) $plot->value->Show(); @@ -278,18 +254,20 @@ class MECON_Graph { $plot->SetCenter($x,$y); } - if (isset($atributos['explotar'])){ - $plot->ExplodeAll($atributos['explotar']); - } + if (isset($atributos['explotar'])) + { + $plot->ExplodeAll($atributos['explotar']); + } - } + }// del if torta $this->_grafico->Add($plot); - if (isset($atributos['posLeyenda'])){ - $this->_grafico->legend->xpos = $atributos['posLeyenda'][0]; - $this->_grafico->legend->ypos = $atributos['posLeyenda'][1]; - } + if (isset($atributos['posLeyenda'])) + { + $this->_grafico->legend->xpos = $atributos['posLeyenda'][0]; + $this->_grafico->legend->ypos = $atributos['posLeyenda'][1]; + } } /** diff --git a/test/Marco/prueba/www/images/perfiles.gif b/test/Marco/prueba/www/images/perfiles.gif index 8f94ed0976f9907a13d7e89dab4aa6d80c143ae5..42adfc44ec976067787fe58bfa1d04688fee3e10 100644 GIT binary patch delta 7 OcmaFGvYlmvITHX3r~;D! delta 59 zcmV-B0L1^d1nLB^Hv%&t!2!br5t=6_K_LNw2oV%Cs4!5%YX!v*(3)<5f&&H2MNnwq Rnt=lIv?N40EL#Kw1_Vew6Jr1X -- 2.43.0