imageline ( resource image,x-coordinate first point,y-coordinate first point,x-coordinate second point,y-coordinate second point,colour )

Now we need to set up some information so we can place these bars.

PHP Code:

$x = 15; // set how far from the side then how far from next bar$y = 230; // set where bar should reach on the y in this case on the y line we created$x_width = 20; // Width of each of the bars $y_ht = 0; //height of the bars

Now we can start creating the bars themself.

PHP Code:

for ($i=0;$i<7;$i++){

$y_ht = ($data[$i]/$sum)* $height; // work out height and make sure they don't go larger then the image