mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 08:02:41 +02:00
Percentage bar code
git-svn-id: http://www.observium.org/svn/observer/trunk@106 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
// returns a PNG graph from the $_GET['per'] variable
|
||||
$width = '201';
|
||||
$height = '7';
|
||||
$per = imagecreate($width,$height);
|
||||
$background = imagecolorallocate($per, 0xFF, 0xFF, 0xFF);
|
||||
$foreground = imagecolorallocate($per, 0x00, 0x8A, 0x01);
|
||||
$border = imagecolorallocate($per, 0x99, 0x99, 0x99);
|
||||
if ($_GET['per'] > 0) {
|
||||
$grad = imagecreatefrompng("images/grad.png");
|
||||
$per2 = imagecopy($per, $grad, 1, 1, 0, 0, ($_GET['per'] * $width / 100), 5);
|
||||
imagerectangle($per, 0, 0, $width-1, $height-1 , $border);
|
||||
}
|
||||
header("Content-type: image/png");
|
||||
imagepng($per, '', 100);
|
||||
?>
|
||||
Reference in New Issue
Block a user