diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2003-11-30 12:15:19 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2003-11-30 12:15:19 +0000 |
| commit | 5a779fd72ae289e8290760f8fb6ff341dd166ffb (patch) | |
| tree | 0b0d52df181ecbe058edcb0684441e38123b3033 /frontends/php/chart4.php | |
| parent | 7fcb30f02c1dfae9caaab498c2269b6f2cd1ff25 (diff) | |
| download | zabbix-5a779fd72ae289e8290760f8fb6ff341dd166ffb.tar.gz zabbix-5a779fd72ae289e8290760f8fb6ff341dd166ffb.tar.xz zabbix-5a779fd72ae289e8290760f8fb6ff341dd166ffb.zip | |
- redesigned availablity chart (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@1076 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/chart4.php')
| -rw-r--r-- | frontends/php/chart4.php | 46 |
1 files changed, 13 insertions, 33 deletions
diff --git a/frontends/php/chart4.php b/frontends/php/chart4.php index 5982c9f5..0b5de3b0 100644 --- a/frontends/php/chart4.php +++ b/frontends/php/chart4.php @@ -135,6 +135,8 @@ $false[$i]=$stat["false"]; $unknown[$i]=$stat["unknown"]; $count_now[$i]=1; + +// echo $true[$i]." ".$false[$i]."<br>"; } for($i=0;$i<=$sizeY;$i+=$sizeY/10) @@ -162,45 +164,23 @@ $maxX=900; $minX=0; - for($i=1;$i<52;$i++) + for($i=0;$i<52;$i++) { - $x1=(900/52)*$sizeX*($i-$minX)/($maxX-$minX); - $y1=$sizeY*($true[$i]-$minY)/($maxY-$minY); - $x2=(900/52)*$sizeX*($i-$minX-1)/($maxX-$minX); - $y2=$sizeY*($true[$i-1]-$minY)/($maxY-$minY); - $y1=$sizeY-$y1; - $y2=$sizeY-$y2; - - ImageLine($im,$x1+$shiftX,$y1+$shiftYup,$x2+$shiftX,$y2+$shiftYup,$darkred); - - ImageRectangle($im,$x1+$shiftX-1,$y1+$shiftYup-1,$x1+$shiftX+1,$y1+$shiftYup+1,$darkred); - ImageRectangle($im,$x2+$shiftX-1,$y2+$shiftYup-1,$x2+$shiftX+1,$y2+$shiftYup+1,$darkred); $x1=(900/52)*$sizeX*($i-$minX)/($maxX-$minX); - $y1=$sizeY*($false[$i]-$minY)/($maxY-$minY); - $x2=(900/52)*$sizeX*($i-$minX-1)/($maxX-$minX); - $y2=$sizeY*($false[$i-1]-$minY)/($maxY-$minY); - $y1=$sizeY-$y1; - $y2=$sizeY-$y2; - ImageLine($im,$x1+$shiftX,$y1+$shiftYup,$x2+$shiftX,$y2+$shiftYup,$darkgreen); + ImageFilledRectangle($im,$x1+$shiftX,$shiftYup,$x1+$shiftX+8,$sizeY+$shiftYup,ImageColorAllocate($im,200,200,120)) +; + $y1=$sizeY*$true[$i]/100; - ImageRectangle($im,$x1+$shiftX-1,$y1+$shiftYup-1,$x1+$shiftX+1,$y1+$shiftYup+1,$darkgreen); - ImageRectangle($im,$x2+$shiftX-1,$y2+$shiftYup-1,$x2+$shiftX+1,$y2+$shiftYup+1,$darkgreen); + ImageFilledRectangle($im,$x1+$shiftX,$shiftYup,$x1+$shiftX+8,$y1+$shiftYup,ImageColorAllocate($im,200,120,120)); - $x1=(900/52)*$sizeX*($i-$minX)/($maxX-$minX); - $y1=$sizeY*($unknown[$i]-$minY)/($maxY-$minY); - $x2=(900/52)*$sizeX*($i-$minX-1)/($maxX-$minX); - $y2=$sizeY*($unknown[$i-1]-$minY)/($maxY-$minY); + $y1=$sizeY*$false[$i]/100; $y1=$sizeY-$y1; - $y2=$sizeY-$y2; - - ImageLine($im,$x1+$shiftX,$y1+$shiftYup,$x2+$shiftX,$y2+$shiftYup,$darkyellow); - ImageRectangle($im,$x1+$shiftX-1,$y1+$shiftYup-1,$x1+$shiftX+1,$y1+$shiftYup+1,$darkyellow); - ImageRectangle($im,$x2+$shiftX-1,$y2+$shiftYup-1,$x2+$shiftX+1,$y2+$shiftYup+1,$darkyellow); + ImageFilledRectangle($im,$x1+$shiftX,$y1+$shiftYup,$x1+$shiftX+8,$sizeY+$shiftYup,ImageColorAllocate($im,120,200,120)); -# ImageStringUp($im, 1, $x1+10, $sizeY+$shiftYup+15, $i , $red); + ImageRectangle($im,$x1+$shiftX,$shiftYup,$x1+$shiftX+8,$sizeY+$shiftYup,$black); } for($i=0;$i<=$sizeY;$i+=$sizeY/10) @@ -208,15 +188,15 @@ ImageString($im, 1, $sizeX+5+$shiftX, $sizeY-$i-4+$shiftYup, $i*($maxY-$minY)/$sizeY+$minY , $darkred); } - ImageFilledRectangle($im,$shiftX,$sizeY+$shiftYup+39+15*0,$shiftX+5,$sizeY+$shiftYup+35+9+15*0,$darkgreen); + ImageFilledRectangle($im,$shiftX,$sizeY+$shiftYup+39+15*0,$shiftX+5,$sizeY+$shiftYup+35+9+15*0,ImageColorAllocate($im,120,200,120)); ImageRectangle($im,$shiftX,$sizeY+$shiftYup+39+15*0,$shiftX+5,$sizeY+$shiftYup+35+9+15*0,$black); ImageString($im, 2,$shiftX+9,$sizeY+$shiftYup+15*0+35, "FALSE (%)", $black); - ImageFilledRectangle($im,$shiftX,$sizeY+$shiftYup+39+15*1,$shiftX+5,$sizeY+$shiftYup+35+9+15*1,$darkred); + ImageFilledRectangle($im,$shiftX,$sizeY+$shiftYup+39+15*1,$shiftX+5,$sizeY+$shiftYup+35+9+15*1,ImageColorAllocate($im,200,120,120)); ImageRectangle($im,$shiftX,$sizeY+$shiftYup+39+15*1,$shiftX+5,$sizeY+$shiftYup+15+9+35*1,$black); ImageString($im, 2,$shiftX+9,$sizeY+$shiftYup+15*1+35, "TRUE (%)", $black); - ImageFilledRectangle($im,$shiftX,$sizeY+$shiftYup+39+15*2,$shiftX+5,$sizeY+$shiftYup+35+9+15*2,$darkyellow); + ImageFilledRectangle($im,$shiftX,$sizeY+$shiftYup+39+15*2,$shiftX+5,$sizeY+$shiftYup+35+9+15*2,ImageColorAllocate($im,200,200,120)); ImageRectangle($im,$shiftX,$sizeY+$shiftYup+39+15*2,$shiftX+5,$sizeY+$shiftYup+35+9+15*2,$black); ImageString($im, 2,$shiftX+9,$sizeY+$shiftYup+15*2+35, "UNKNOWN (%)", $black); |
