<?php
include ("../jpgraph.php");
include ("../jpgraph_bar.php");
include ("../jpgraph_line.php");
$datay=array(2,3,5,8.5,11.5,6,3);
// Create the graph.
$graph = new Graph(350,300);
$graph->SetScale("textlin");
$graph->SetMarginColor('navy:1.9');
$graph->SetBox();
$graph->title->Set('Bar Pattern');
$graph->title->SetFont(FF_ARIAL,FS_BOLD,20);
$graph->SetTitleBackground('lightblue:1.3',TITLEBKG_STYLE2,TITLEBKG_FRAME_BEVEL);
$graph->SetTitleBackgroundFillStyle(TITLEBKG_FILLSTYLE_HSTRIPED,'lightblue','blue');
// Create a bar pot
$bplot = new BarPlot($datay);
$bplot->SetFillColor('darkorange');
$bplot->SetWidth(0.6);
$bplot->SetPattern(PATTERN_CROSS1,'navy');
$graph->Add($bplot);
$graph->Stroke();
?>
JpGraph Error: HTTP headers have already been sent.
Caused by output from file bee1.php at line 11.
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".
Warning: include() [function.include]: Unable to access ../jpgraph.php in C:\AppServ\www\577\testjp\test1.php on line 2
Warning: include(../jpgraph.php) [function.include]: failed to open stream: No error in C:\AppServ\www\577\testjp\test1.php on line 2
Warning: include() [function.include]: Failed opening '../jpgraph.php' for inclusion (include_path='.;C:\php5\pear') in C:\AppServ\www\577\testjp\test1.php on line 2
Warning: include() [function.include]: Unable to access ../jpgraph_bar.php in C:\AppServ\www\577\testjp\test1.php on line 3
Warning: include(../jpgraph_bar.php) [function.include]: failed to open stream: No error in C:\AppServ\www\577\testjp\test1.php on line 3
Warning: include() [function.include]: Failed opening '../jpgraph_bar.php' for inclusion (include_path='.;C:\php5\pear') in C:\AppServ\www\577\testjp\test1.php on line 3
Warning: include() [function.include]: Unable to access ../jpgraph_line.php in C:\AppServ\www\577\testjp\test1.php on line 4
Warning: include(../jpgraph_line.php) [function.include]: failed to open stream: No error in C:\AppServ\www\577\testjp\test1.php on line 4
Warning: include() [function.include]: Failed opening '../jpgraph_line.php' for inclusion (include_path='.;C:\php5\pear') in C:\AppServ\www\577\testjp\test1.php on line 4
Fatal error: Class 'Graph' not found in C:\AppServ\www\577\testjp\test1.php on line 20
Warning: include() [function.include]: Unable to access ../jpgraph.php in C:\AppServ\www\577\testjp\test1.php on line 2
Warning: include(../jpgraph.php) [function.include]: failed to open stream: No error in C:\AppServ\www\577\testjp\test1.php on line 2
Warning: include() [function.include]: Failed opening '../jpgraph.php' for inclusion (include_path='.;C:\php5\pear') in C:\AppServ\www\577\testjp\test1.php on line 2
Warning: include() [function.include]: Unable to access ../jpgraph_bar.php in C:\AppServ\www\577\testjp\test1.php on line 3
Warning: include(../jpgraph_bar.php) [function.include]: failed to open stream: No error in C:\AppServ\www\577\testjp\test1.php on line 3
Warning: include() [function.include]: Failed opening '../jpgraph_bar.php' for inclusion (include_path='.;C:\php5\pear') in C:\AppServ\www\577\testjp\test1.php on line 3
Warning: include() [function.include]: Unable to access ../jpgraph_line.php in C:\AppServ\www\577\testjp\test1.php on line 4
Warning: include(../jpgraph_line.php) [function.include]: failed to open stream: No error in C:\AppServ\www\577\testjp\test1.php on line 4
Warning: include() [function.include]: Failed opening '../jpgraph_line.php' for inclusion (include_path='.;C:\php5\pear') in C:\AppServ\www\577\testjp\test1.php on line 4
Fatal error: Class 'Graph' not found in C:\AppServ\www\577\testjp\test1.php on line 20
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in C:\AppServ\www\jpgraph\src\jpgraph.php on line 322
ทำตาม คุณ amax ข้างบนแล้วแต่ขึ้นแบบนี้อะค่ะ Fatal error: Declaration of GraphTabTitle::SetPos() must be compatible with that of Text::SetPos() in C:\AppServ\www\jpgraph-1.27.1\src\jpgraph.php on line 3175