Staj raporum için bir grafik hazırlıyorum tek bir sorun kaldı, oda beyaz bir boşluk. Resme bakınca anlarsınız

Resim:
Kodlarım:
<?php
$img = imagecreate(500, 250);
imagecolorallocate($img, 255, 255, 255);
$choices = array(
0 => array( 'name' => 'Cuisinière', 'count' => 3, 'red' => 255, 'green' => 0, 'blue' => 0 ),
1 => array( 'name' => 'Lave linge', 'count' => 5, 'red' => 0, 'green' => 128, 'blue' => 0 ),
2 => array( 'name' => 'Micro-ondes', 'count' => 3, 'red' => 0, 'green' => 0, 'blue' => 255 ),
3 => array( 'name' => 'Machine à laver', 'count' => 5, 'red' => 255, 'green' => 255, 'blue' => 0 ),
4 => array( 'name' => 'Frigo', 'count' => 4, 'red' => 255, 'green' => 160, 'blue' => 66 ),
5 => array( 'name' => 'Hotte', 'count' => 3, 'red' => 0, 'green' => 255, 'blue' => 255 ),
6 => array( 'name' => 'Sèche linge', 'count' => 3, 'red' => 255, 'green' => 255, 'blue' => 255 ),
7 => array( 'name' => 'Lave vaisselle', 'count' => 3, 'red' => 255, 'green' => 128, 'blue' => 255 ),
8 => array( 'name' => 'Four', 'count' => 4, 'red' => 255, 'green' => 128, 'blue' => 0 ),
9 => array( 'name' => 'Fer à repasser', 'count' => 4, 'red' => 192, 'green' => 192, 'blue' => 192 ),
);
$divisor = 37;
$precision = 1;
$currentDegree = 0;
$boxNumber = 0;
foreach ($choices as $i => $option)
{
$chunk = floor(($option['count'] * 360) / $divisor);
$percent = floor(($option['count'] * 100) / $divisor);
$options[$i] = array(
'percent' => round($chunk, $precision),
'votes' => $option['count'],
'label' => substr($option['name'], 0, 15) . '(' . round($percent, 0) . '%)',
'color' => imagecolorallocate($img, $option['red'], $option['green'], $option['blue']),
'startdeg' => $currentDegree,
'enddeg' => $currentDegree + $chunk,
'boxxpos' => 210 + ($boxNumber > 7 ? 150 : 0),
'boxypos' => 25 + (($boxNumber % 8) * 20)
);
$currentDegree += $chunk;
$boxNumber++;
}
$black = imagecolorallocate($img, 0, 0, 0);
Imagettftext($img, 10,0,10,12,$black,'D:\\xampp\\htdocs\\staj\\trebuc.ttf','Bilan');
foreach ($options as $id => $option)
{
imagefilledarc($img, 100, 115, 190, 190, $option['startdeg'], $option['enddeg'], $option['color'], IMG_ARC_PIE);
imagefilledarc($img, 100, 115, 190, 190, $option['startdeg'], $option['enddeg'], $black, IMG_ARC_NOFILL | IMG_ARC_EDGED);
imagefilledrectangle( $img, $option['boxxpos'], $option['boxypos'], $option['boxxpos'] + 10, $option['boxypos'] + 10, $option['color']);
imagerectangle( $img, $option['boxxpos'], $option['boxypos'], $option['boxxpos'] + 10, $option['boxypos'] + 10, $black);
Imagettftext($img, 10,0,$option['boxxpos'] + 15,$option['boxypos'] + 10,$black,$boarddir . 'D:\\xampp\\htdocs\\staj\\trebuc.ttf',$option['label']);
}
header("Content-type: image/png");
imagepng($img);
imagedestroy($img);
?>