diff options
author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2003-11-28 23:54:57 +0000 |
---|---|---|
committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2003-11-28 23:54:57 +0000 |
commit | 48c44659cbebd2fb4df8d66f257a6436298a38bd (patch) | |
tree | c8e60134448d4a3e589f285ed09fa9882d3fc7af /frontends/php/chart5.php | |
parent | 3b3ad83489cf0f50c6bf283a118935af367fd403 (diff) | |
download | zabbix-48c44659cbebd2fb4df8d66f257a6436298a38bd.tar.gz zabbix-48c44659cbebd2fb4df8d66f257a6436298a38bd.tar.xz zabbix-48c44659cbebd2fb4df8d66f257a6436298a38bd.zip |
- redesigned availability chart (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@1064 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/chart5.php')
-rw-r--r-- | frontends/php/chart5.php | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/frontends/php/chart5.php b/frontends/php/chart5.php index d68d1bc6..6d3798f8 100644 --- a/frontends/php/chart5.php +++ b/frontends/php/chart5.php @@ -152,31 +152,40 @@ $maxX=900; $minX=0; - for($i=1;$i<52;$i++) + for($i=1;$i<=52;$i++) { - $x1=(900/52)*$sizeX*($i-$minX)/($maxX-$minX); - $y1=$sizeY*($problem[$i]-$minY)/($maxY-$minY); - $x2=(900/52)*$sizeX*($i-$minX-1)/($maxX-$minX); - $y2=$sizeY*($problem[$i-1]-$minY)/($maxY-$minY); - $y1=$sizeY-$y1; - $y2=$sizeY-$y2; +// $x1=(900/52)*$sizeX*($i-$minX)/($maxX-$minX); +// $y1=$sizeY*($problem[$i]-$minY)/($maxY-$minY); +// $x2=(900/52)*$sizeX*($i-$minX-1)/($maxX-$minX); +// $y2=$sizeY*($problem[$i-1]-$minY)/($maxY-$minY); +// $y1=$sizeY-$y1; +// $y2=$sizeY-$y2; - ImageLine($im,$x1+$shiftX,$y1+$shiftYup,$x2+$shiftX,$y2+$shiftYup,$darkred); +// 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); +// 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*($ok[$i]-$minY)/($maxY-$minY); + +// $x1=(900/52)*$sizeX*($i-$minX)/($maxX-$minX); +// $y1=$sizeY*($ok[$i]-$minY)/($maxY-$minY); $x2=(900/52)*$sizeX*($i-$minX-1)/($maxX-$minX); $y2=$sizeY*($ok[$i-1]-$minY)/($maxY-$minY); - $y1=$sizeY-$y1; +// $y1=$sizeY-$y1; $y2=$sizeY-$y2; - ImageLine($im,$x1+$shiftX,$y1+$shiftYup,$x2+$shiftX,$y2+$shiftYup,$darkgreen); +// ImageLine($im,$x1+$shiftX,$y1+$shiftYup,$x2+$shiftX,$y2+$shiftYup,$darkgreen); + +// 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,$x2+$shiftX,$y2+$shiftYup,$x2+$shiftX+8,$sizeY+$shiftYup,ImageColorAllocate($im,100,200,100)); + ImageRectangle($im,$x2+$shiftX,$y2+$shiftYup,$x2+$shiftX+8,$sizeY+$shiftYup,$black); +// Doesn't work for some reason + ImageFilledRectangle($im,$x2+$shiftX,$shiftYup,$x2+$shiftX+8,$y2+$shiftYup,ImageColorAllocate($im,200,100,100)); + ImageRectangle($im,$x2+$shiftX,$shiftYup,$x2+$shiftX+8,$y2+$shiftYup,$black); +// ImageRectangle($im,$x2+$shiftX,$sizeY+$shiftYup,$x2+$shiftX+8,$shiftYup,$black); - 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); /* $x1=(900/52)*$sizeX*($i-$minX)/($maxX-$minX); @@ -196,7 +205,7 @@ for($i=0;$i<=$sizeY;$i+=$sizeY/10) { - ImageString($im, 1, $sizeX+5+$shiftX, $sizeY-$i-4+$shiftYup, $i*($maxY-$minY)/$sizeY+$minY , $darkred); + 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); |