Rextangle

GD and GD2 are useful libraries for creating graphics on-the-fly. Discuss your PHP GD and GD2 scripts here.

Moderators: onion2k, General Moderators

Post Reply
sandy1028
Forum Commoner
Posts: 60
Joined: Thu Jul 26, 2007 3:56 am

Rextangle

Post 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);
?>
Post Reply