Ver Mensaje Individual
  #1 (permalink)  
Antiguo 06/02/2011, 00:43
dancresi
 
Fecha de Ingreso: marzo-2005
Mensajes: 372
Antigüedad: 19 años, 1 mes
Puntos: 1
Error con JpGraph Error: HTTP headers have already been sent

Hola Amigos estoy graficando con jpgraph y tengo el siguiente problema, y la verdad es que no tengo ningun echo, por ninguna parte, no se a que se refiere y siempre es en la linea 1, copio y pego ejemplos de internete y en todos me sale este mismo error.

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

Código PHP:
<?php
require_once ('src/jpgraph.php');
require_once (
'src/jpgraph_bar.php');
$data1y=array(8,8,9,3,5,6);
$data2y=array(18,2,1,7,5,4);
$graph = new Graph(500,400); 
$graph->SetScale("textlin");
$graph->SetShadow();
$graph->img->SetMargin(40,30,20,40);
$b1plot = new BarPlot($data1y);
$b1plot->SetFillColor("orange");
$b1plot->value->Show();
$b2plot = new BarPlot($data2y);
$b2plot->SetFillColor("blue");
$b2plot->value->Show();
$gbplot = new AccBarPlot(array($b1plot,$b2plot));
$graph->Add($gbplot);
$graph->title->Set("Accumulated bar plots");
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->Stroke();
?>
saludos