=UNIX_TIMESTAMP('".strftime("%Y-%m-%d %H:%M", $firsttime)."') AND timestamp$maxwert) { $maxwert=$wert[0][$hpos]/$count[0][$hpos]; } if ((strftime("%M",$result0[0])=="00") || ($result0[0]==$firsttime) || ($result0[0]==$lasttime)) { if (($result0[0]<>$lasttime) || (strftime("%M",$result0[0])>12)) { $hourlines[strftime("%H:%M",$result0[0])]=$hpos; } } } $punkte[0]=array($borderleft,$height+$bordertop); #Anfangspunkt festlegen #$punkte[1]=array($borderleft,$height+$bordertop); if ($maxwert==0) { $maxwert=0.00001; } $heightperwert=$height/$maxwert; for ($i=0;$i<=$hpos;$i++) { if (isset($count[0][$i])) { if ($count[0][$i]>0) { #Durchschnittswert bilden $wert[0][$i]=$wert[0][$i]/$count[0][$i]; } if ($wert[0][$i]==0) { array_push($punkte[0], $i+$borderleft, $height+$bordertop); } else { array_push($punkte[0], $i+$borderleft, $height-(floor($wert[0][$i]))*$heightperwert+$bordertop); } # if ((floor($wert[1][$i]))==0) { # array_push($punkte[1], $i+$borderleft, $height+$bordertop); # } else { # array_push($punkte[1], $i+$borderleft, $height-(floor($wert[1][$i]))*$heightperwert+$bordertop); # } } } # array_push($punkte[0], $width+$borderleft, $height+$bordertop); # array_push($punkte[1], $width+$borderleft, $height+$bordertop); #senkrechte Linien malen und beschriften reset($hourlines); $pos=current($hourlines); # ImageString($im, 1, $pos+$borderleft-10, $height+$bordertop+3, key($hourlines), $schwarz); ImageTTFText($im, 7, 60, $pos+$borderleft-5, $height+$bordertop+25, $schwarz, $ttf, key($hourlines)); next($hourlines); while ($pos=current($hourlines)) { ImageLine($im, $pos+$borderleft, $bordertop, $pos+$borderleft, $height+$bordertop, $dunkelgrau); # ImageString($im, 1, $pos+$borderleft-12, $height+$bordertop+3, key($hourlines), $schwarz); ImageTTFText($im, 7, 60, $pos+$borderleft-5, $height+$bordertop+25, $schwarz, $ttf, key($hourlines)); next($hourlines); } #horizontale Linien malen for ($i=0;$i<4;$i++) { ImageLine($im, $borderleft, $i*floor($height/4)+$bordertop, $width+$borderleft, $i*floor($height/4)+$bordertop, $dunkelgrau); ImageString($im, 1, $borderleft-18, $height-($i+1)*floor($height/4)+$bordertop-4, floor($maxwert*($i+1)/4), $schwarz); } ImageString($im, 1, $borderleft-10, $height+$bordertop-7, 0, $schwarz); for ($i=1;$i<(sizeof($punkte[0])/2);$i++) { ImageLine($im, $punkte[0][2*($i-1)], $punkte[0][2*($i-1)+1], $punkte[0][2*$i], $punkte[0][2*$i+1], $rot); } ImageLine($im, $borderleft, $bordertop+$height, $borderleft+$width, $bordertop+$height, $schwarz); ImageLine($im, $borderleft, $bordertop, $borderleft, $bordertop+$height, $schwarz); ImageLine($im, $borderleft, $bordertop, $borderleft+$width, $bordertop, $schwarz); ImageLine($im, $borderleft+$width, $bordertop, $borderleft+$width, $bordertop+$height, $schwarz); $titlestring="AC-Power Pac in W ("; switch ($tag) { case 0: $titlestring.="today"; break; case 1: $titlestring.="yesterday"; break; case 2: $titlestring.="day before yesterday"; break; case 3: $titlestring.="3 days ago"; break; } $titlestring.=")"; ImageString($im, 3, $borderleft, $height+$bordertop+28, $titlestring, $schwarz); # $titlestring="Green line: count of really accepted emails (spams already excluded)"; # ImageString($im, 3, $borderleft, $height+$bordertop+30, $titlestring, $schwarz); } else { ImageString($im, 3, $borderleft, $height+$bordertop+30, "no data available", $schwarz); } ImagePNG ($im); ?>