Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/09/2012, 09:42
Hobitt
 
Fecha de Ingreso: octubre-2006
Ubicación: Xoxocotla, Morelos Mexico
Mensajes: 243
Antigüedad: 17 años, 7 meses
Puntos: 0
Como se inserta un gráfico de JGRAPH?

Hola a todos.

Tengo una web en la que necesito meterle gráficas (barras, pastel, lineas) utilizando JGRAPH, soy nuevo con esta librería y tengo ya un ejemplo de gráfica, la cual se muestra bien en una ventana "vacía" es decir, que únicamente tenga la gráfica, pero si intento cargarla dentro de una página de mi WEB me arroja error de HEADERS.

Les platico rápidamente, mi web es una pantalla dividida (con etiquetas DIV) esto para tener un encabezado, zona de menu, zona de mensajes, zona de contenido (aquí es donde quiero mostrar mi gráfica), zona de paginación y zona de pie de página.

Toda mi web funciona mediante inclusiones de scripts (include: "Directorio.php") a la zona de contenido.

Pero al querer cargar el script que me genera la gráfica me arroja el siguiente error:

"JpGraph Error: HTTP headers have already been sent.
Caused by output from file index.php at line 9."



HTTP headers have already been sent back to the browser indicating the data as text before the library got a chance to send it's image HTTP header to this browser. This makes it impossible for the library to send back image data to the browser (since that would be interpretated as text by the browser and show up as junk text).
Most likely you have some text in your script before the call to Graph::Stroke(). If this texts gets sent back to the browser the browser will assume that all data is plain text. Look for any text, even spaces and newlines, that might have been sent back to the browser.

For example it is a common mistake to leave a blank line before the opening "<?php".



Entiendo que es por todo lo que contiene la página index.php, hay alguna forma de solventar esto? porque lo mas sencillo es generar las gráficas en una ventana nueva, pero no se ve muy bien el asunto de que la muestre aparte.

Gracias!!