views:

244

answers:

2

Hi,

I am trying to use the pchart package (over php) to build (and directly display) graphs/charts. At this time, I am just trying to run their provided example (Example1.php), where I just have replaced the final:

$Test->Render("example1.png");

by

$Test->Stroke();

But When I do this, I get:" The image cannot be displayed because it contains errors" on the browser. If I leave the original $Test->Render(...) the generated image is OK. (but not sent)

I have read that there is (was?) an issue with mozilla/Firefox browsers regarding images being required twice and the REFER URL, but when I browse at the pchart home page, I can use their "sanboxes" and get the result of my tests directly displayed on my browser (http://pchart.sourceforge.net/demo.php). ... So their must be a way (or a nice work around) to send the generated graphs directely to the browser successfuly.

If your answer is to generate the image (i.e. use Render) and then send it afterwards, please but accurate on how to do this (how do I destroy the generated files automaticaly, permissions...)

I am new to this, sorry advance if it's obvious...;-)

A: 

I don't know PChart, but stuff like this is most often down to PHP error messages polluting the PNG image.

Try saving the damaged image to disk, and opening it with an Editor like Notepad++. See whether there is anything meaningful in the first few lines of the file.

Pekka
A: 

I've found the same problem. See my ticket at bugtacker: http://sourceforge.net/tracker/?func=detail&aid=2991928&group_id=227755&atid=1071632

DR