sandy1028 Posted July 30, 2007 Share Posted July 30, 2007 Hi, Facing problem in plotting when the fixed width and heigth is given $graphValues=array($avg,$max); // Define .PNG image header("Content-type: image/png"); $imgWidth=50; $imgHeight=15; // Create image and define colors $image=imagecreate($imgWidth, $imgHeight); $colorWhite=imagecolorallocate($image, 0, 255, 255); $colorGrey=imagecolorallocate($image, 192, 192, 192); $colorBlue=imagecolorallocate($image, 0, 0, 255); $colorred=imagecolorallocate($image, 255, 0, 0); imagefill($image, 0, 0, $colorGrey); $avg_val= ($imgWidth * $avg)/$max; //verticle lines imageline($image, $i*50, 0, $i*50, 50, $colorGrey); imagefilledrectangle($image, 0 ,0,$avg_val,$imgWidth,$colorred); //Horizontal lines //destroy the image imagepng($image); imagedestroy($image); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.