Page 1 of 1

Rextangle

Posted: Thu Jul 26, 2007 4:03 am
by sandy1028
Hi,

I am new to php graphs.....
How to plot the average value against the maximum value when width and heigth of the rectangle is fixed...
Till the average value from the start of rectangle the color should be filled in different color.

Please help me with this

Code: Select all

<?php

$max=200;
$avg=300;
$min=400;
$image = imagecreate(400,200);
$yellow = imagecolorallocate($image, 255, 255, 0);
$purple = imagecolorallocate($image, 2,2,55);
imagefilledrectangle($image, 0, 0, $avg, 200, $purple);
//imagestring($image, 5 , 400 , 500 , Hi , $purple);



header("Content-Type: image/png");
imagepng ($image);
imagedestroy($image);
?>