use PHP to create SVG graph

SVGGraph is an object-oriented PHP library for creating simple PHP graphs, released as open source under the LGPL v3 license. Here are some examples of different types of graph supported by SVGGraph.
         
Download a copy of the library here: SVGGraph2.14.zip [129k] or SVGGraph2.14.tar.bz2 [64k].
If you are still using PHP4, then you should use version 1.2.1 of SVGGraph: SVGGraph.zip [35k] orSVGGraph.tar.bz2 [25k]. Please read the included README.txt file for the correct instructions for the earlier version.
This library provides PHP classes and functions for easily creating SVG graphs from data. As of version 2.0, SVGGraph works with PHP 5 only, PHP 4 support has been dropped.
Here is a basic example:

 $graph = new SVGGraph(640, 480);
 $graph->colours = array('red','green','blue');
 $graph->Values(100, 200, 150);
 $graph->Links('/Tom/', '/Dick/', '/Harry/');
 $graph->Render('BarGraph');
This will create a SVG file containing a 640x480 bar graph with three hyperlinked bars.


留言

這個網誌中的熱門文章

How to PHP export to Excel 2

html viewport meta