I'm looking at adding some basic line graphs to a page. Enabled gd, and
started in on pear::image_graph. Just wanting to start simple, I created a
new graph, set the background color, and displayed it. I also added the
header call to set the content for jpeg, but all I get is a bunch of
characters on my screen.
Here's the (excerpted) simple code:
Header ("Content-type: image/jpeg");
$defwidth = 300;
$defheight = 200;
$mychart = new Image_Graph($defwidth, $defheight);
$mychart->setBackgroundColor("white");
// build the chart
imagejpeg($mychart->getGDImage());
I also couldn't figure out what setBackgroundColor expected, Are there any
samples about for this?
Thanks,
Greg