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); Link to comment https://forums.phpfreaks.com/topic/62442-problem-in-plotting/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.