Home  >  Article  >  Backend Development  >  PHP chart class JpGraph helps us draw dazzling charts_PHP tutorial

PHP chart class JpGraph helps us draw dazzling charts_PHP tutorial

WBOY
WBOYOriginal
2016-07-15 13:34:19918browse

In

before, when drawing with PHP, you had to master complex and abstract drawing functions, or use some bar chart and pie chart classes downloaded from the Internet. accomplish. There is no unified chart class to achieve rapid development of charts.

Now we have a new choice: the PHP chart class JpGraph. A class library dedicated to providing charts. It makes drawing a very simple thing. You only need to retrieve relevant data from the database, define the title and chart type, and then leave the rest to JpGraph. You only need to master a few JpGraph built-in functions. You can draw very dazzling charts!

Installation method of PHP chart class JpGraph:

1. First, you need to download the latest version http://www.aditus.nu/jpgraph/.

2. Make sure your PHP version is at least 4.04 (preferably 4.1.1) and supports the GD library. You must ensure that the GD library can run normally. You can check whether the GD library information exists by running phpinfo(). At the same time, it is required that the version of the GD library should be 2.0, not 1.0.

3. Unzip the downloaded JpGraph compressed package to any folder.

4. Set jpgraph.php (jpgraph’s main configuration file). Set jpgraph's cache (cache) folder and TTF (font) folder.

Linux system changes to:

DEFINE("CACHE_DIR","/tmp/jpgraph_cache/");'
DEFINE("TTF_DIR","/usr/X11R6/lib/ X11/fonts/truetype/");

Windows system changes to:

DEFINE("CACHE_DIR","c:/apache/htdocs/ jpgraph_cache/");'
DEFINE ("TTF_DIR", "c:/windows/fonts");

Notes on PHP chart class JpGraph:

(1) The cache folder path can be defined by yourself, while TTF The (font) folder must be %system%/Fonts.
(2) Make sure PHP has write permissions on the cache folder.


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/445997.htmlTechArticleIn the past, when drawing with PHP, you had to master complex and abstract drawing functions, or use some cylindrical shapes downloaded from the Internet. Chart and pie chart classes are implemented. There is no unified chart class to implement...
Statement:
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