From: Manuel Nazar Anchorena Date: Mon, 26 Jan 2004 15:22:10 +0000 (+0000) Subject: Se emprolijo el codigo X-Git-Tag: svn_import~132 X-Git-Url: https://git.llucax.com/mecon/meconlib.git/commitdiff_plain/9926f1886cad61ddd622978a55d2c7909460e733?ds=inline Se emprolijo el codigo --- 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 8f94ed0..42adfc4 100644 Binary files a/test/Marco/prueba/www/images/perfiles.gif and b/test/Marco/prueba/www/images/perfiles.gif differ