Page 1 of 1

filledpolygon

Posted: Mon Sep 24, 2007 3:43 am
by sandy1028
This code creates the line graph.
I want to fill the color from start to end point of line graph.

I tried using the imagefilledpolygon but I am not able to pass the array of values.

Please help me with this


Code: Select all

// Create line graph
for ($i=0; $i<$count; $i++){

$graphValues[$i]=round(($graphValues[$i]*$yheight)/$max,2);
}

for($i=0;$i<$count;$i++){
imageline($image,40+$i*$xinc,(40+125-$graphValues[$i]),40+($i+1)*$xinc,(40+125-$graphValues[$i+1]),$colorBlue);

imagefilledpolygon($image,array(40,$graphValues[$i+1],165,$graphValues[$i]),$count,$black);
}


Posted: Mon Sep 24, 2007 7:40 am
by superdezign
You are only giving imagefilledpolygon() two points. That's not a polygon.