Question

I am developing a web application about statistics, so I am using the library jpgraph

What is going wrong is that the graph does not appear. Displays only the browser's broken image icon.

$num  = 20;
$num2 = 10;
$data = array($num,$num2);

$graph = new PieGraph(300,200);
$graph->SetShadow();
$graph->title->Set("Utilizadores Registados");

$p1 = new PiePlot($data);
$graph->Add($p1);
$graph->Stroke();

I am sure that GD is enable.

Thank you!

Was it helpful?

Solution

My guess is that your output contains PHP error messages, such as:

Fatal error: Class 'PieGraph' not found

Browsers tend to make it difficult to inspect the source code of a script that generates an image but you should find a way to do it. Commenting out this line:

$graph->Stroke();

... can be a starting point.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top