Foros del Web » Programando para Internet » PHP »

Problemas con jpgraph

Estas en el tema de Problemas con jpgraph en el foro de PHP en Foros del Web. Hola a todos!, wueno tengo un problema que por lo visto a mucha gente le sucede, quiero aprender ha utiilizar graficos jpgraph y para ello ...
  #1 (permalink)  
Antiguo 13/08/2009, 02:02
 
Fecha de Ingreso: agosto-2009
Mensajes: 3
Antigüedad: 14 años, 8 meses
Puntos: 0
Problemas con jpgraph

Hola a todos!, wueno tengo un problema que por lo visto a mucha gente le sucede, quiero aprender ha utiilizar graficos jpgraph y para ello me he bajado un codigo de ejemplo de internet, despues he activado las extensiones php.ini para la libreria gd2.dll y he colocado correctamente la libreria del jpgraph, sin embargo me muestra el siguiente mensaje de error:

JpGraph Error: HTTP headers have already been sent.
Caused by output from file prova_grafica.php at line 8.
Explanation:
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".


Por lo que he leido hay personas que lo resuleven borrando "una linea blanca" intermedia...yo las he borrado todas y sigue dando ese error, haber si alguien le sucedio un problema similar y me puede orientar un poco porfavor, aqui teneis el codigo:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
</head>
<body>
<?php
include("jpgraph.php");
include("jpgraph_line.php");
$ydata = array(11, 3, 8, 12, 5, 1, 9, 13, 5, 7);
$graph = new Graph(350, 250, "auto");
$graph->SetScale("textlin");
$lineplot = new LinePlot($ydata);
$lineplot->SetColor("blue");
$graph->Add($lineplot);
$graph->Stroke();
?>
</body>
</html>
  #2 (permalink)  
Antiguo 13/08/2009, 02:07
 
Fecha de Ingreso: agosto-2009
Mensajes: 3
Antigüedad: 14 años, 8 meses
Puntos: 0
Respuesta: Problemas con jpgraph

Bien acabo de solucionar el problema y voy a dejar clarito el COMO SE RESUELVE para que así futuras generaciones no sufran lo que he sufrido yo...fijaos en la parte superior del codigo......BORRANDO todo lo que hay por encima de <?php se resuelve...asi de sencillo, esto sucede porque he utilizado DREAMWEAVER el cual genera ese tozo de codigo de manera automatica en todos los archivos que se abren como nuevos.

Un saludo a todos
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 11:49.