Ver Mensaje Individual
  #1 (permalink)  
Antiguo 08/09/2009, 14:18
Twonex
 
Fecha de Ingreso: julio-2009
Ubicación: .mysql_error ( XD )
Mensajes: 554
Antigüedad: 14 años, 9 meses
Puntos: 13
No muestra el HTML

la verdad no sé si esta consulta está bien planteada en este foro (php)
lo que ocurre es que estoy trabajando con graficos, para ello uso la libreria ChartDirector y me funciona al 100. el problema es que me ignora todo codigo html, por lo cual el grafico lo muestra solo sin el CSS en un fondo blanco como es lo normal...

mi codigo es el siguiente

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

y no muestra nada del <html> *** </html>
ni el enlace para volver ni la hoja de estilo CSS

esop... como puedo hacer para que no me ignore el html y muestre todo?
__________________
Mi Bosque de Sombras Solo Doom Metal!

por favor use esta etiqueta para publicar su código --->[HIGHLIGHT]