3 Stimmen

Warum sehe ich diese seltsame Linie in meinem GD-Kuchendiagramm?

Warum sehe ich diese seltsame Linie in meinem GD-Kuchendiagramm?

pie graph

Hier ist das PHP:

<?php
$ratio = $_GET['ratio'];
$height = intval(isset($_GET['size']) ? $_GET['size'] : 200);
$width = intval(isset($_GET['size']) ? $_GET['size'] : 200);
$startDegree = 270;
$ratiodeg = $ratio * 360;
$image = imagecreatetruecolor($width,$height);
imagealphablending($image,false);
imagesavealpha($image,true);
$color = imagecolorallocate($image,127,26,40);
$grey = imagecolorallocate($image,200,200,200);
$transparent = imagecolorallocatealpha($image,255,255,255,127);
imagefilledrectangle($image,0,0,$width,$height,$transparent);
if($ratio > 0){
    if($ratio < 1){
        imagefilledarc($image,$width / 2,$height / 2,$width,$height,$ratiodeg + $startDegree,$startDegree,$grey,IMG_ARC_PIE);
    }
    imagefilledarc($image,$width / 2,$height / 2,$width,$height,$startDegree,$ratiodeg + $startDegree,$color,IMG_ARC_PIE);
}
else{
    imagefilledarc($image,$width / 2,$height / 2,$width,$height,$startDegree,360 + $startDegree,$grey,IMG_ARC_PIE);
}
imagefilledellipse($image,$width / 2,$height / 2,$width * 0.95,$height * 0.95,$transparent);
header("Content-type: image/png");
imagepng($image);
imagedestroy($image);
?>

CodeJaeger.com

CodeJaeger ist eine Gemeinschaft für Programmierer, die täglich Hilfe erhalten..
Wir haben viele Inhalte, und Sie können auch Ihre eigenen Fragen stellen oder die Fragen anderer Leute lösen.

Powered by:

X