In
In the past, when using PHP to plot images, you must master complex abstract drawing functions, or use some classes of bar chart and pie chart downloaded from the Internet. There is no unified chart class for quick chart development.
Now we have a new option: PHP chart class JpGraph. Class Libraries dedicated to providing charts. It makes plotting a very simple task. You only need to extract the relevant data from the database, define the title, chart type, and then hand over the data to JpGraph, you only need to know a few built-in JpGraph functions to draw very dazzling charts!
How to install JpGraph for PHP charts:
1. download the latest version http://www.aditus.nu/jpgraph /.
2. Make sure that your PHP version is 4.04 (preferably 4.1.1) and supports the GD library. Make sure that the GD library runs properly. You can run phpinfo () to check whether the GD library information exists. At the same time, the version of the GD library must be 2.0, instead of 1.0.
3. decompress the downloaded JpGraph package to any folder.
4. Set jpgraph. php (main configuration file of jpgraph ). Set the cache folder and TTF folder of jpgraph.
For Linux:
DEFINE ("CACHE_DIR", "/tmp/jpgraph_cache /");'
DEFINE ("TTF_DIR", "/usr/X11R6/lib/X11/fonts/truetype /");
For Windows:
DEFINE ("CACHE_DIR", "c:/apache/htdocs/jpgraph_cache /");'
DEFINE ("TTF_DIR", "c:/windows/fonts ");
Considerations for PHP charts and JpGraph:
(1) The cache (cache) folder path can be customized, while the TTF (font) folder must be % system %/Fonts.
(2) Make sure that PHP has the write permission on the cache folder.