An open API service indexing awesome lists of open source software.

https://github.com/dbrgn/gd-progressbar

A progressbar class for PHP using GDLib
https://github.com/dbrgn/gd-progressbar

Last synced: 11 months ago
JSON representation

A progressbar class for PHP using GDLib

Awesome Lists containing this project

README

          

gd-progressbar
==============

This is a simple PHP class that I created some time ago. It does nothing fancy, just creating a
simple GD based progress bar. Probably there are many other classes like this out there :)

Usage
-----

Constructor:

function __construct($curVal, $maxVal=100, $width=500, $height=20, $absVal=false, $suffix='')

Methods:

public function setValue($curVal, $maxVal=100)
public function setSize($width, $height)
public function setSuffix($suffix)
public function setAbsVal($absVal)
public function setBackgroundColor($r, $g, $b)
public function setBorderColor($r, $g, $b)
public function setProgressColor($r, $g, $b)
public function setFontColor($r, $g, $b)
public function draw()

For further information, see source documentation.

Examples
--------

```php
draw();
?>
```

![Example 1](http://github.com/dbrgn/gd-progressbar/raw/master/example1.png)

```php
setValue(275, 900);
$p->draw();
?>
```

![Example 2](http://github.com/dbrgn/gd-progressbar/raw/master/example2.png)

```php
setAbsVal(true);
$p->setSuffix('days');
$p->setProgressColor(100, 150, 200);
$p->setFontColor(220, 220, 255);
$p->setBackgroundColor(220, 220, 255);
$p->draw();
?>
```

![Example 3](http://github.com/dbrgn/gd-progressbar/raw/master/example3.png)

License
-------

LGPLv3 http://www.gnu.org/licenses/lgpl.html