The PHP chart type JpGraph helps us draw a dazzling chart

Source: Internet
Author: User

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.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.