PHP Classes

Header error

Recommend this page to a friend!

      baaChart  >  All threads  >  Header error  >  (Un) Subscribe thread alerts  
Subject:Header error
Summary:"Headers already sent" error on line 189
Messages:4
Author:Martin Samler
Date:2005-01-02 17:26:53
Update:2005-01-03 17:18:23
 

  1. Header error   Reply   Report abuse  
Picture of Martin Samler Martin Samler - 2005-01-02 17:26:53
Looks real good, but I am getting this error:

Warning: Cannot modify header information - headers already sent by (output started at /test/baatest.php:9) in /test/baaChart.php on line 189)

Should the optional replace parameter be used?

  2. Re: Header error   Reply   Report abuse  
Picture of Barry Andrew Barry Andrew - 2005-01-02 19:55:41 - In reply to message 1 from Martin Samler
I can only guess that line 9 is where you call

chart->display()

This method has a call to

header(("Content-Type: image/png");

Are you also outputting a similar header in baatest.php?

  3. Re: Header error   Reply   Report abuse  
Picture of Martin Samler Martin Samler - 2005-01-03 00:41:54 - In reply to message 2 from Barry Andrew
Barry, I found out that the error was caused by empty lines in the downloaded file (line 188 in baachart.php, among others). After deleting the empty lines everything works just fine.

I was looking for something to generate small line graphs, like the one on http://tipstraders.com/public2/NL_SP_Focus.htm . The problem with this seems to be the text size.

Any way to reduce the text size, or work around it?

Thanks,
Martin

  4. Re: Header error   Reply   Report abuse  
Picture of Barry Andrew Barry Andrew - 2005-01-03 17:18:23 - In reply to message 3 from Martin Samler
Perhaps create a subclass 'baaSmallChart' overriding the _drawxaxis, _drawyaxis, _drawlegend, _drawtitle, _maxlab methods with the above changes


I think those are the relevant methods with imagestring calls

You could search for occurences of 'imagestring' and alter the the second argument to '1' (smallest size).

Also, so that text centering is maintained, alter the argument in 'imagefontwidth()' calls too.

hth

Barry