From 94ac90491b67eb843acf5974057c0426e6f4b73a Mon Sep 17 00:00:00 2001 From: Myrna Degano Date: Wed, 28 Jan 2004 18:43:56 +0000 Subject: [PATCH] =?utf8?q?=20Se=20modifica=20el=20m=C3=A9todo=20acumular?= =?utf8?q?=20para=20que=20las=20secuencias=20se=20pinten=20autom=C3=A1tica?= =?utf8?q?mente=20de=20diferentes=20colores.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- lib/MECON/Graph.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/MECON/Graph.php b/lib/MECON/Graph.php index 64627e7..36185ac 100644 --- a/lib/MECON/Graph.php +++ b/lib/MECON/Graph.php @@ -280,12 +280,9 @@ class MECON_Graph { * $v2 = array(1,28,9,13,1,5); * * $graph =& new MECON_Graph ("xy", 300, 300, 'PRUEBA'); - * - * $attribs1 = array('colorRelleno'=>'green'); - * $attribs2 = array('colorRelleno'=>'orange'); * - * $b1plot = $graph->agregarSecuencia("barras", $v1, $attribs1); - * $b2plot = $graph->agregarSecuencia("barras", $v2, $attribs2); + * $b1plot = $graph->agregarSecuencia("barras", $v1); + * $b2plot = $graph->agregarSecuencia("barras", $v2); * * $graph->acumular(array($b1plot, $b2plot)); * $graph->generar(); @@ -299,6 +296,13 @@ class MECON_Graph { */ function acumular ($secuencias) { + $rgb = new RGB(); + $colores = array_keys ($rgb->rgb_table); + + // Esto pinta cada secuencia de un color diferente + for ($i=0; $i< count($secuencias); $i++) + $secuencias[$i]->SetFillColor ($colores[$i]); + $accplot = new AccBarPlot($secuencias); $this->_grafico->Add($accplot); } -- 2.43.0