Ver Mensaje Individual
  #5 (permalink)  
Antiguo 05/01/2010, 07:08
Twonex
 
Fecha de Ingreso: julio-2009
Ubicación: .mysql_error ( XD )
Mensajes: 554
Antigüedad: 14 años, 9 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
  1. <?php
  2. $anio = $_GET["ano"];
  3.  
  4. if ($anio == "-- Año --" )
  5. {
  6.     echo "<script>alert('Debes Seleccionar Un Año')</script>";
  7.     echo "<script>history.back()</script>";
  8. }
  9.  
  10. else
  11. {
  12.     include ("funciones.php"); //funcion que conecta a la BBDD
  13.     conectar();
  14.    
  15.     $consulta = "Select * From total Where año='$anio' AND tipo='Capex'";
  16.     $resultado = mysql_query ($consulta);
  17.  
  18.     $i=0;
  19.     while ($registro = mysql_fetch_array($resultado))
  20.     {
  21.         $Categorias[$i] = $registro["categorias"];
  22.         $Enero[$i] = $registro["enero"];
  23.         $Febrero[$i] = $registro["febrero"];
  24.         $Marzo[$i] = $registro["marzo"];
  25.         $Abril[$i] = $registro["abril"];
  26.         $Mayo[$i] = $registro["mayo"];
  27.         $Junio[$i] = $registro["junio"];
  28.         $Julio[$i] = $registro["julio"];
  29.         $Agosto[$i] = $registro["agosto"];
  30.         $Septiembre[$i] = $registro["septiembre"];
  31.         $Octubre[$i] = $registro["octubre"];
  32.         $Noviembre[$i] = $registro["noviembre"];
  33.         $Diciembre[$i] = $registro["diciembre"];
  34.  
  35.         $i++;
  36.     }
  37.  
  38. include ("ChartDirector/lib/phpchartdir.php");
  39.  
  40. $colors = 0xFF9933;
  41.  
  42. $dato = array ("Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic");
  43.  
  44. $valor = array ($Enero[0], $Febrero[0], $Marzo[0], $Abril[0], $Mayo[0], $Junio[0], $Julio[0],
  45.                 $Agosto[0], $Septiembre[0], $Octubre[0], $Noviembre[0], $Diciembre[0]);
  46.  
  47. # Create a XYChart object. Set background color to brushed
  48. # silver, with a 2 pixel 3D border. Use rounded corners of 20 pixels radius.
  49. $c = new XYChart(600, 380, brushedSilverColor(), Transparent, 5);
  50.  
  51. # Add a title to the chart using 18pts Times Bold Italic font.
  52. # Set top/bottom margins to 8 pixels.
  53. $textBoxObj = $c->addTitle("Capex Anual", "timesbi.ttf", 18);
  54. $textBoxObj->setMargin2(0, 0, 10, 10);
  55.  
  56. # Set the plotarea at (70, 55) and of size 460 x 280 pixels. Use transparent border
  57. # and black grid lines. Use rounded frame with radius of 20 pixels.
  58. $c->setPlotArea(70, 55, 460, 280, -1, -1, Transparent, 0x000000);
  59. $c->setRoundedFrame(0xffffff, 20);
  60.  
  61. # Add a multi-color bar chart layer using the supplied data. Set cylinder bar shape.
  62. $barLayerObj = $c->addBarLayer($valor, $colors);
  63. $barLayerObj->setBarShape(CircleShape);
  64.  
  65. # Set the labels on the x axis.
  66. $c->xAxis->setLabels($dato);
  67.  
  68. # Show the same scale on the left and right y-axes
  69. $c->syncYAxis();
  70.  
  71. # Set the left y-axis and right y-axis title using 10pt Arial Bold font
  72. $c->yAxis->setTitle("USD (millions)", "arialbd.ttf", 10);
  73. $c->yAxis2->setTitle("USD (millions)", "arialbd.ttf", 10);
  74.  
  75. # Set y-axes to transparent
  76. $c->yAxis->setColors(Transparent);
  77. $c->yAxis2->setColors(Transparent);
  78.  
  79. # Disable ticks on the x-axis by setting the tick color to transparent
  80. $c->xAxis->setTickColor(Transparent);
  81.  
  82. # Set the label styles of all axes to 8pt Arial Bold font
  83. $c->xAxis->setLabelStyle("arialbd.ttf", 8);
  84. $c->yAxis->setLabelStyle("arialbd.ttf", 8);
  85. $c->yAxis2->setLabelStyle("arialbd.ttf", 8);
  86.  
  87. }
  88.  
  89. //mostrar Grafico (imagen)
  90. header("Content-type: image/jpeg");
  91. echo($c->makeChart2(JPG));
  92.  
  93. ?>



y donde muestro el grafico es acá

Código PHP:
Ver original
  1. </head>
  2. <body>
  3. <?php
  4. $anio = $_POST["ano"];
  5. $url = 'grafico_CapexAnual.php?ano='.$anio;
  6. ?>
  7.  
  8. <img src="<?php echo $url ?>"> <br>
  9.  
  10. <form action="capexAnual.php" method="post">
  11.     <input type="submit" class="estilocelda3" value="Volver Atras">
  12. </form>
  13. </body>
  14. </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]