Hallo!
Ich ahbe einen Code. Dort im Kommentar steht shcon drinne, an was cih verzweifele!
	
							
						
					Ich ahbe einen Code. Dort im Kommentar steht shcon drinne, an was cih verzweifele!
PHP-Code:
	
	
<?php
    $hoch=250;
    $breit=320;
    $breit_m=420;
    ### Intialisieren
        $legende[]="Views";
        $legende[]="Klicks x10";
        $legende[]="PopUps";
    #Header( "Content-type: image/png"); 
    $im = imagecreate ($breit_m,$hoch); 
    $white = ImageColorAllocate($im, 0xFF, 0xFF, 0xFF);
    $grey = ImageColorAllocate($im, 0xE0, 0xE0, 0xE0); 
    $grey2 = ImageColorAllocate($im, 0xA0, 0xA0, 0xA0); 
    $grey3 = ImageColorAllocate($im, 0xD0, 0xD0, 0xD0); 
    $green = ImageColorAllocate($im, 0x00, 0xFF, 0x00); 
    $black = ImageColorAllocate($im, 0x00, 0x00, 0x00); 
    $black = ImageColorAllocate($im,0x00,0x00,0x00);
    $cl[0] = ImageColorAllocate($im,0xFF,0x00,0x00); 
    $cl[3] = ImageColorAllocate($im,0xFF,0x33,0xFF);
    $cl[2] = ImageColorAllocate($im,0xEA,0x99,0x00);
    $cl[1] = ImageColorAllocate($im,0x00,0xFF,0x00);
    $cl[4] = ImageColorAllocate($im,0x00,0xCC,0xFF);
    $cl[5] = ImageColorAllocate($im,0x99,0x33,0xCC);
    ImageFilledRectangle($im,0,0,$breit_m,$hoch,$white);
    ImageFilledRectangle($im,35,10,$breit-10,$hoch-30,$grey);
    ImageRectangle($im, 0, 0, $breit_m-1, $hoch-1, $black);
        $max = "7543"; // Besucher gesamt!
    ## X-Achsen anschreiben
    if($max > 1000) {
        $max=floor(($max+1000)/1000)*1000;
        $mitte=$max/2;
    } elseif($max > 100) {
        $max=floor(($max+100)/100)*100;
        $mitte=$max/2;
    } else {
        $max=floor(($max+10)/10)*10;
        $mitte=$max/2;
    }
    ## Y-Achse anschreiben
    ImageString ($im,2,$breit-50,$hoch-27,'23 Uhr',$black);
    ImageString ($im,2,13,$hoch-27,'0 Uhr',$black);
    $temp=floor(($hoch-40)/2)+10;
    $abstand=($breit-15-35)/23;
    for($i=0;$i<=23;$i++) {
        ImageLine($im, (35+$i*$abstand), $hoch-29, (35+$i*$abstand), $hoch-31, $black);
        ImageLine($im, (35+$i*$abstand), $hoch-31, (35+$i*$abstand), 10, $grey3);
    }
    ImageLine($im, 35, $temp, $breit-10, $temp, $grey2);
    ImageLine($im, 35, 15, $breit-10, 15, $grey2);
    ImageLine($im, 35, 10, 35, $hoch-30, $black);
    ImageLine($im, 35, $hoch-30, $breit-10, $hoch-30, $black);
    ImageString ($im,2,5,11,$max,$black);
    ImageString ($im,2,5,$temp-4,$mitte,$black);
    
    #Kurve zeichnen
        ImageLine($im, $hoch-30, $hoch-30, 220, 15, $cl[0]);
                // Hier ist 15 die höhe, für das ganze (8000).
        // Wie kann ich nun automatisch errechnen, was da stehen muss, für 2000?
    ##Legende
    ImageString ($im,3,$breit_m-92,27,"Legende",$black);
    ImageRectangle($im, $breit_m-95, 25, $breit_m-15, 230, $black);
    $a=0;
    while(list($abfall,$temp)=@each($legende)) {
        ImageLine($im, $breit_m-89, 48+($a*11), $breit_m-85, 48+($a*11), $cl[$a]);
        ImageLine($im, $breit_m-89, 47+($a*11), $breit_m-85, 47+($a*11), $cl[$a]);
        ImageLine($im, $breit_m-89, 46+($a*11), $breit_m-85, 46+($a*11), $cl[$a]);
        ImageString ($im,2,$breit_m-80,40+($a*11),$temp,$black);
        $a++;
    }
    
    ImagePNG($im); 
    ImageDestroy($im); 
?>
 
          
Kommentar