Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> GD - help
GrayHat
post
Post #1





Grupa: Zarejestrowani
Postów: 566
Pomógł: 18
Dołączył: 23.08.2003
Skąd: Łomża

Ostrzeżenie: (0%)
-----


Napisałem skrypt wykresu:

[php:1:f05959f49e]
<?php
/* GrayKres v. 0.1
Copyright 2003 by GrayHat
All Rights Reserved!
*/
header ("Content-type: image/png");

$i=0;
$m=0;

$slopkow=24;
$pic=ImageCreate(20*$slopkow,250);
$col1=ImageColorAllocate($pic,200,200,200); // color GRAY?? (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
$col2=ImageColorAllocate($pic,255,255,255); // color WHITE
$col3=ImageColorAllocate($pic,100,100,100); // color GRAY?? (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
$col4=ImageColorAllocate($pic,0,0,255); // color BLUE
$col5=ImageColorAllocate($pic,255,0,0); // color RED


for($j=0; $j<$slopkow; $j++) {
$D[$j] = rand(1,2000);
$Legenda[$j] = "Godz. ".$j;
}

$max = max($D);
for ($k=0; $k<$slopkow; $k++){
$proc[$k]= ($D[$k] / $max)*100;
$od[$k] = 250 - $proc[$k];
}
while ($i < $slopkow){
$odl= 20*$i;
ImageFilledRectangle($pic,$odl+7,$od[$i]-2,$odl+12,250,$col2);
ImageFilledRectangle($pic,$odl+5,$od[$i],$odl+10,250,$col3);
imagestringup ($pic,2,$odl+1, $od[$i]-10, "$D[$i] ($Legenda[$i])",$col4);
imagestring ($pic, 3, 5, 5, "Wykres ver uproszczona", $col3);
$i++;
}
while ($m< $slopkow-1){
$odl= 20*$m;
ImageLine($pic,$odl+8,$od[$m],$odl+28,$od[$m+1],$col5);



$m++;
}
ImagePNG($pic);
ImageDestroy($pic);
?>
?>[/php:1:f05959f49e]


noi wszystko by było dobrze, tylko jak chce go wyświetlić na innej stronie to sie wali i wyskakuja krzaki same.... co jest źle?
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 25.12.2025 - 19:32