Estou tentando usar a classe jpgraph mas quando executo qualquer exemplo a imagem não aparece no browser. Mostra só o icone padrão de espaço de imagem não encontrada.
Estou usando WAMP (não sei se tem alguma coisa a ver).
Já testei a biblioteca GD e está ok.
Nas pesquisas que fiz parece que a configuração é simples mas comigo não funciona. Já testei em 3 máquinas com configurações diferentes e nada.
Não sei mais o que fazer.
Será que alguém sabe aonde pode estar o problema ou já teve este problema.
Encontrei o erro! A duras penas.
Existe um erro no script do arquivo jpgraph.php da classe do jpgraph. Eu havia editado a diretriz error_reporting no meu php.ini para tratar erros como E-ALL (error_reporting = E-ALL) e quando o erro do jpgrph era encontrado a execução do script era interrompida. Então mudei para E_ALL | E_STRICT e pude ver a reportação do erro. Não sei bem o que significa, mas acho que não importa. A solução foi não reportar o erro e o gráfico foi exibido normalmente.
Aqui vai um artigo muito bom sobre tratamento de erros para quem se interessar (http://www.kdphp.com...rror_reporting/)
e abaixo o erro reportado no script do jpgraph:
De qualquer forma tá resolvido!
----------
JpGraph Error: HTTP headers have already been sent.
Caused by output from file jpgraph.php at line 381.
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".
---------