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);
}