For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > July 2005 > Image_Graph: works when output is to file.png but throws errors it outputs to screen









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Image_Graph: works when output is to file.png but throws errors it outputs to screen
l Burnerheimerton

2005-07-31, 9:00 am

Here's the example I am using - straight out of the
documentation. It works fine if you output it to a
file using:

$Graph->done(array('filename' => './output.png'));

But when I use the following it does not work:

<?php
include 'Image/Graph.php';
$Graph =& Image_Graph::factory('graph', array(400,
300));
$Plotarea =& $Graph->addNew('plotarea');
$Dataset =& Image_Graph::factory('dataset');
$Dataset->addPoint('Denmark', 10);
$Dataset->addPoint('Norway', 3);
$Dataset->addPoint('Sweden', 8);
$Dataset->addPoint('Finland', 5);
$Plot =& $Plotarea->addNew('bar', &$Dataset);
$Graph->done();
?>

The above code throws errors:

Warning: Cannot modify header information - headers
already sent by (output started at
C:\test\TMPi9nskho3w.php:1) in
c:\pear\lib\Image\Graph\Driver.php on line 525

Warning: Cannot modify header information - headers
already sent by (output started at
C:\test\TMPi9nskho3w.php:1) in
c:\pear\lib\Image\Graph\Driver.php on line 526

Warning: Cannot modify header information - headers
already sent by (output started at
C:\test\TMPi9nskho3w.php:1) in
c:\pear\lib\Image\Graph\Driver.php on line 527

Warning: Cannot modify header information - headers
already sent by (output started at
C:\test\TMPi9nskho3w.php:1) in
c:\pear\lib\Image\Graph\Driver.php on line 528

Warning: Cannot modify header information - headers
already sent by (output started at
C:\test\TMPi9nskho3w.php:1) in
c:\pear\lib\Image\Graph\Driver\GD\PNG.php on line 104

Any ideas are much appreciated!

________________________________________
__________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com