Home > Backend Development > PHP Tutorial > How to install, configure and use Jpgraph_PHP tutorial

How to install, configure and use Jpgraph_PHP tutorial

WBOY
Release: 2016-07-13 17:39:16
Original
1324 people have browsed it

Jpgraph is a powerful drawing component that can draw any graphics according to the user's needs. You only need to provide data, and the drawing function process can be automatically called, and the processed data can be input for automatic drawing. Jpgraph provides a variety of methods to create various statistical charts, including line charts, column charts, and pie charts. Jpgraph is a class library written entirely in PHP language and can be applied in any PHP environment.

 It should be noted that if you are under a LINUX system, the path of the font must be the system path. For example, the font is placed in /var/fonts/default/font.ttf. You must use this completely when using it. The path of

Jpgraph installation

Jpgraph can be downloaded from its official website http://www.aditus.nu/jpgraph/. Note that Jpgraph supports two versions of graphics libraries: PHP 4.3.1 or above and PHP 5. Choose the appropriate Jpgraph to download. The latest version currently is 2.3.

The installation method of Jpgraph is very simple. After downloading the file, the installation steps are as follows:

(1) Extract all files under the compressed package into a folder, such as F:AppServwwwjpgraph.

(2) Open the PHP installation directory, edit the php.ini file and modify the include_path parameter, and then add the previous folder name, such as include_path = ".;F:AppServwwwjpgraph".

 (3) Restart the Apache server to take effect.

Note: Jpgraph requires the support of GD library. If the user wants the Jpgraph class library to be only valid for the current site, just copy all the files in the src folder under the Jpgraph compressed package to the folder in the directory where the website is located. When using it, call the specified file in the src folder. Can. These contents will be explained in detail in the following typical examples.

Jpgraph configuration

Jpgraph provides a file jpg-config.inc.php specifically used to configure the Jpgraph class library. Before using Jpgraph, you can complete the configuration of Jpgraph by modifying the text file.

The configuration of jpg-config.inc.php file needs to modify the following two items.

Support Chinese configuration

The Chinese standard fonts supported by Jpgraph can be completed by modifying the settings of CHINESE_TTF_FONT.

DEFINE(CHINESE_TTF_FONT,bkai00mp.ttf); Configuration of default image format

Set the default generated image format according to the image format supported in the current PHP environment. The configuration of Jpgraph's default image format can be completed by modifying the settings of DEFAULT_GFORMAT. The default value auto means that Jpgraph will retrieve the image formats supported by the system in the order of PNG, GIF and JPEG. DEFINE("DEFAULT_GFORMAT","auto"); Note: If the user is using Jpgraph 2.3 version, there is no need to reconfigure it.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/486313.htmlTechArticleJpgraph is a powerful drawing component that can draw any graphics according to the user's needs. You only need to provide data, and the drawing function process can be automatically called, and the processed data can be input for automatic drawing. ...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template