![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
05/01/2010, 07:08
|
| | Fecha de Ingreso: julio-2009 Ubicación: .mysql_error ( XD )
Mensajes: 554
Antigüedad: 15 años, 7 meses Puntos: 13 | |
Respuesta: No muestra el HTML amigo... eso ya lo resolvi
lo que debes hacer es pasar los datos por variables a traves de un GET
en ese ejemplo yo usaba POST!!
te dejo acá el codigo de ese mismo ejemplo, pero bueno!
Código PHP:
Ver original<?php $anio = $_GET["ano"]; if ($anio == "-- Año --" ) { echo "<script>alert('Debes Seleccionar Un Año')</script>"; echo "<script>history.back()</script>"; } else { include ("funciones.php"); //funcion que conecta a la BBDD conectar(); $consulta = "Select * From total Where año='$anio' AND tipo='Capex'"; $i=0; { $Categorias[$i] = $registro["categorias"]; $Enero[$i] = $registro["enero"]; $Febrero[$i] = $registro["febrero"]; $Marzo[$i] = $registro["marzo"]; $Abril[$i] = $registro["abril"]; $Mayo[$i] = $registro["mayo"]; $Junio[$i] = $registro["junio"]; $Julio[$i] = $registro["julio"]; $Agosto[$i] = $registro["agosto"]; $Septiembre[$i] = $registro["septiembre"]; $Octubre[$i] = $registro["octubre"]; $Noviembre[$i] = $registro["noviembre"]; $Diciembre[$i] = $registro["diciembre"]; $i++; } include ("ChartDirector/lib/phpchartdir.php"); $colors = 0xFF9933; $dato = array ("Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic"); $valor = array ($Enero[0], $Febrero[0], $Marzo[0], $Abril[0], $Mayo[0], $Junio[0], $Julio[0], $Agosto[0], $Septiembre[0], $Octubre[0], $Noviembre[0], $Diciembre[0]); # Create a XYChart object. Set background color to brushed # silver, with a 2 pixel 3D border. Use rounded corners of 20 pixels radius. $c = new XYChart(600, 380, brushedSilverColor(), Transparent, 5); # Add a title to the chart using 18pts Times Bold Italic font. # Set top/bottom margins to 8 pixels. $textBoxObj = $c->addTitle("Capex Anual", "timesbi.ttf", 18); $textBoxObj->setMargin2(0, 0, 10, 10); # Set the plotarea at (70, 55) and of size 460 x 280 pixels. Use transparent border # and black grid lines. Use rounded frame with radius of 20 pixels. $c->setPlotArea(70, 55, 460, 280, -1, -1, Transparent, 0x000000); $c->setRoundedFrame(0xffffff, 20); # Add a multi-color bar chart layer using the supplied data. Set cylinder bar shape. $barLayerObj = $c->addBarLayer($valor, $colors); $barLayerObj->setBarShape(CircleShape); # Set the labels on the x axis. $c->xAxis->setLabels($dato); # Show the same scale on the left and right y-axes $c->syncYAxis(); # Set the left y-axis and right y-axis title using 10pt Arial Bold font $c->yAxis->setTitle("USD (millions)", "arialbd.ttf", 10); $c->yAxis2->setTitle("USD (millions)", "arialbd.ttf", 10); # Set y-axes to transparent $c->yAxis->setColors(Transparent); $c->yAxis2->setColors(Transparent); # Disable ticks on the x-axis by setting the tick color to transparent $c->xAxis->setTickColor(Transparent); # Set the label styles of all axes to 8pt Arial Bold font $c->xAxis->setLabelStyle("arialbd.ttf", 8); $c->yAxis->setLabelStyle("arialbd.ttf", 8); $c->yAxis2->setLabelStyle("arialbd.ttf", 8); } //mostrar Grafico (imagen) header("Content-type: image/jpeg"); echo($c->makeChart2(JPG)); ?>
y donde muestro el grafico es acá
Código PHP:
Ver original</head> <body> <?php $anio = $_POST["ano"]; $url = 'grafico_CapexAnual.php?ano='.$anio; ?> <img src="<?php echo $url ?>"> <br> <form action="capexAnual.php" method="post"> <input type="submit" class="estilocelda3" value="Volver Atras"> </form> </body> </html>
espero te sirva!
saludos
acepto karma :P
__________________ Mi Bosque de Sombras Solo Doom Metal!
por favor use esta etiqueta para publicar su código --->[HIGHLIGHT] |