• 18-02-2009, 19:36:06
    #1
    Eposta Aktivasyonu Gerekmekte
    Saatlerdir uğraşıyorum hatayı bulamadım.
    <?php
    header("Content-type:image/gif");
    $veri=array('sad','asdasd','verii','delii');
    $pasta=array(50,85,25,35,67);
    $toplam=array_sum($pasta);
    $width=420;
    $height=240;
    $img=imagecreate(420,240);
    $bg=imagecolorallocate($img,255,255,255);
    $width=200;
    $height=200;
    $cx=$width/2;
    $cy=$height/2;
    $start=0;
    for($i=0; $i<count($pasta);$i++) {
    $e=round(($pasta[$i]/$toplam)*100,2);
    $end=round(($e*360)/100);
    $rgb1=rand(200,255);
    $rgb2=rand(100,255); 
    $rgb3=$rand(0,255);
    $renk=imagecolorallocate($img,$rgb1,$rgb2,$rgb3);
    imagefilledarc($img,$cx,$cy,$width,$height,$start,$start+$end,$renk,IMAGE_ARC_PIE);
    imagefilledrectangle($img,250,50+($i*20),264,64+($i*20),$renk);
    imagestring($img,3,276,52+($i*20),$veri[$i].'[%'.$e.']',$renk);
    $start+=$end;
    }
    imagegif($img);
    imagedestroy($img);
    ?>

    EDİT:

    Hatayı buldum kafayı yemekten kurduldum.
    imagefilledarc($img,$cx,$cy,$width,$height,$start, $start+$end,$renk,IMAGE_ARC_PIE);
    yerine
    imagefilledarc($img,$cx,$cy,$width,$height,$start, $start+$end,$renk,IMG_ARC_PIE);

    yazmam gerekiyormuş.
  • 18-02-2009, 20:34:01
    #2
    Üyeliği durduruldu
    Dualwarior adlı üyeden alıntı: mesajı görüntüle
    Saatlerdir uğraşıyorum hatayı bulamadım.
    <?php
    header("Content-type:image/gif");
    $veri=array('sad','asdasd','verii','delii');
    $pasta=array(50,85,25,35,67);
    $toplam=array_sum($pasta);
    $width=420;
    $height=240;
    $img=imagecreate(420,240);
    $bg=imagecolorallocate($img,255,255,255);
    $width=200;
    $height=200;
    $cx=$width/2;
    $cy=$height/2;
    $start=0;
    for($i=0; $i<count($pasta);$i++) {
    $e=round(($pasta[$i]/$toplam)*100,2);
    $end=round(($e*360)/100);
    $rgb1=rand(200,255);
    $rgb2=rand(100,255); 
    $rgb3=$rand(0,255);
    $renk=imagecolorallocate($img,$rgb1,$rgb2,$rgb3);
    imagefilledarc($img,$cx,$cy,$width,$height,$start,$start+$end,$renk,IMAGE_ARC_PIE);
    imagefilledrectangle($img,250,50+($i*20),264,64+($i*20),$renk);
    imagestring($img,3,276,52+($i*20),$veri[$i].'[%'.$e.']',$renk);
    $start+=$end;
    }
    imagegif($img);
    imagedestroy($img);
    ?>
    EDİT:
    Hatayı buldum kafayı yemekten kurduldum.
    imagefilledarc($img,$cx,$cy,$width,$height,$start, $start+$end,$renk,IMAGE_ARC_PIE);
    yerine
    imagefilledarc($img,$cx,$cy,$width,$height,$start, $start+$end,$renk,IMG_ARC_PIE);
    yazmam gerekiyormuş.
    Bir

    Aynı Değişken Adından İkişer Tane Var Değerleri Farklı

    $width=200;
    $height=200;

    $width=420;
    $height=240;

    Daha Sorun Bulamadım Cıkarsa Yazarsın Bi Dene