my code goes like this :
<?
$infile = fopen("mem.dat", "r");
if (!$infile)
{
echo "File not found! Please copy the required file into the directory!<br><br>";
exit;
}
$h = 0;
while(!feof($infile))
{
$myline = fgets($infile ,150);
$spl_myline = explode($myline,",");
//copy slitted string to iData and strData
$iData[$h] = intval($spl_myline[0]);
$strData[$h] = strval(trim($spl_myline[6]));
$h++;
}
fclose($infile);
header("Content-type: image/gif");
$max_y = max($iData);
$max_x = 600;
$imageHeight = 700;
$imageWidth = $max_x + 20;
$y_interval = 10;
$x_scale = $max_x / ($h+1);
$y_scale = 500 / $max_y;
$left_margin = 50;
$bottom_margin = 100;
//end variable declarations
$image = imagecreate($imageWidth, $imageHeight);
$colorRed = imagecolorallocate($image, 255, 0, 0);
$colorBlack = imagecolorallocate($image, 0, 0, 0);
$colorBlue = imagecolorallocate($image, 0, 0, 255);
$colorWhite = imagecolorallocate($image, 255, 255, 255);
$colorGrey = imagecolorallocate($image, 200, 200, 200);
imagefill($image, 0, 0, $colorWhite);
//y-axis label
imagestringup($image, 3, $left_margin/2, $imageHeight/2,
"Active Memory (KBytes)", $colorBlue);
//x-axis label
imagestring($image, 3, ($imageWidth - $left_margin) /2,
($imageHeight-$bottom_margin)+($bottom_margin/2) / 2,
"Date", $colorBlue);
this might be suffice I think, previously it looks fine with IIS, but when I switched to Apache nothing appears.