| 1 |
SVGGraph PHP SVG graph library |
| 2 |
============================== |
| 3 |
|
| 4 |
SVGGraph generates a variety of graphs in SVG format. |
| 5 |
For examples, documentation, etc. please see: http://www.goat1000.com/svggraph.php |
| 6 |
|
| 7 |
This library is released under LGPL-3.0. |
| 8 |
|
| 9 |
Example usage: |
| 10 |
|
| 11 |
```php |
| 12 |
<?php |
| 13 |
// if you are using composer you can skip this |
| 14 |
require 'svggraph/autoloader.php'; |
| 15 |
|
| 16 |
// set some options |
| 17 |
$options = [ |
| 18 |
'graph_title' => 'A simple graph', |
| 19 |
'bar_space' => 20, |
| 20 |
]; |
| 21 |
|
| 22 |
// set up an array of values |
| 23 |
$values = [ 100, 200, 140, 130, 160, 150 ]; |
| 24 |
|
| 25 |
// use full namespace to get SVGGraph instance |
| 26 |
$graph = new Goat1000\SVGGraph\SVGGraph(600, 400, $options); |
| 27 |
|
| 28 |
// assign the values |
| 29 |
$graph->values($values); |
| 30 |
|
| 31 |
// render a bar graph |
| 32 |
$graph->render('BarGraph'); |
| 33 |
|
| 34 |
``` |
| 35 |
|