gibberish instead of an image
I'm a web developer looking at some new tools that will allow my clients to display better charts and graphs with a more dynamic capability. I'm evaluating the pChart package to achieve this goal, but I'm having issues with the image being displayed incorrectly.
What I end up with is the image being displayed as wall of gibberish text as displayed in the attached image. I'm assuming this is because there's some issue with a character encoding variable some where, maybe in the web server configuration, that isn't being set properly.
Any insight would be appreciated.
This is the file I'm using to create the graph called graphTest.php
Code:
<?php
/* Include all the classes */
include($_SERVER['DOCUMENT_ROOT']."/scripts/php/pChart2.1.3/class/pDraw.class.php");
include($_SERVER['DOCUMENT_ROOT']."/scripts/php/pChart2.1.3/class/pImage.class.php");
include($_SERVER['DOCUMENT_ROOT']."/scripts/php/pChart2.1.3/class/pData.class.php");
/* Create your dataset object */
$myData = new pData();
/* Add data in your dataset */
$myData->addPoints(array(VOID,3,4,3,5));
/* Create a pChart object and associate your dataset */
$myPicture = new pImage(700,230,$myData);
/* Choose a nice font */
$myPicture->setFontProperties(array("FontName"=>$_SERVER['DOCUMENT_ROOT']."/scripts/php/pChart2.1.3/fonts/Forgotte.ttf","FontSize"=>11));
/* Define the boundaries of the graph area */
$myPicture->setGraphArea(60,40,670,190);
/* Draw the scale, keep everything automatic */
$myPicture->drawScale();
/* Draw the scale, keep everything automatic */
$myPicture->drawSplineChart();
/* Build the PNG file and send it to the web browser */
$myPicture->Stroke();
?>