How to install and configure Jpgraph. Jpgraph, a powerful drawing component, can draw any image as needed. You only need to provide the data to automatically call the plotting function and draw the processed data input. Jpgraph, a powerful drawing component, can draw any image as needed. You only need to provide the data to automatically call the plotting function and draw the processed data input. Jpgraph provides multiple methods to create statistical charts, including line charts, column charts, and pie charts. Jpgraph is a class library fully written in PHP and can be applied in any PHP environment.
Note that in LINUX, the font path must be the system Path. for example, the font should be/var/fonts/default/font. ttf you must use this complete path when using it.
Jpgraph installation
Jpgraph can be downloaded from its official website http://www.aditus.nu/jpgraph. Note that Jpgraph supports the graphics libraries of PHP 4.3.1 and later versions and selects the appropriate Jpgraph for download. The latest version is 2.3.
The Jpgraph installation method is very simple. after the file is downloaded, the installation steps are as follows:
(1) decompress all the files in the compressed package to a folder, for example, F: AppServwwwjpgraph.
(2) open the PHP installation directory, edit the php. ini file, modify the include_path parameter, and add the preceding folder name, such as include_path = ".; F: AppServwwwjpgraph ".
(3) restart the Apache server to take effect.
Note: Jpgraph requires the support of the GD Library. If you want the Jpgraph class library to be valid only for the current site, you only need to copy all the files in the src folder under the Jpgraph compressed package to the folder where the website is located, you can call the specified file in the src folder for use. These content will be explained in the following typical examples.
Jpgraph configuration
Jpgraph provides a file jpg-config.inc.php dedicated to configuring the Jpgraph class library. Before using Jpgraph, you can modify a text file to complete Jpgraph configuration.
The configuration of the jpg-config.inc.php file needs to be modified in either of the following ways.
Supports Chinese configuration
You can modify the CHINESE_TTF_FONT settings for Standard Chinese fonts supported by Jpgraph.
DEFINE (CHINESE_TTF_FONT, bkai00mp. ttf); default image format configuration
Set the default format for generating images based on the image formats supported in the current PHP environment. You can modify DEFAULT_GFORMAT to configure the default image format of Jpgraph. By default, auto indicates that Jpgraph searches supported Image formats in the order of PNG, GIF, and JPEG. DEFINE ("DEFAULT_GFORMAT", "auto"); Note: If you are using Jpgraph 2.3, you do not need to reconfigure it.
Bytes. You only need to provide data to automatically call the drawing function process, and input the processed data to be automatically drawn ....