PHP Implementation report (Jpgraph plugin implementation)

Source: Internet
Author: User
Installation and configuration of the Jpgraph

1, the official website downloads the file package

2. Unzip the package

3, copy to your development environment----Note is: The SRC directory of all other files cut into the examples file, in the cut is first set up in examples Jpgraph folder (the name must be Jpgraph, Because its function file reference is the file name is the subject)

Leave only Docportal and Examples this 2 files can be

4, perform your local environment---can see all jpgraph cases: http://localhost/Bbiao/jpgraph/Examples/


Jpgraph support for language files--------jpgraph_ttf.inc.php

Chinese font
Define ("Ff_simsun", 30);
Define ("Ff_chinese", 31);
Define ("Ff_big5", 32);



Like what:

Require_once (' jpgraph/jpgraph.php ');
Require_once (' jpgraph/jpgraph_bar.php ');

$datay 1=array (13,8,19,7,17,6);
$datay 2=array (40,5,2,7,5,25);

Create the graph.
$graph = new Graph (350,250);
$graph->setscale (' Textlin ');
$graph->setmargincolor (' White ');

Setup Title
$graph->title->set (Iconv ("UTF-8", "Gb2312//ignore", "The three cannons, I want to support Chinese!") ")) ; Support Chinese title
$graph->title->setfont (ff_simsun,fs_bold,14);
Create the first bar
$bplot = new Barplot ($datay 1);
$bplot->setfillgradient (' AntiqueWhite2 ', ' antiquewhite4:0.8 ', grad_vert);
$bplot->setcolor (' darkred ');

Create the second bar
$bplot 2 = new Barplot ($datay 2);
$bplot 2->setfillgradient (' olivedrab1 ', ' olivedrab4 ', grad_vert);
$bplot 2->setcolor (' Darkgreen ');

and join them in an accumulated bar
$accbplot = new Accbarplot (Array ($bplot, $bplot 2));
$graph->add ($accbplot);

$graph->stroke ();
?>

PHP reporting requirements can be achieved!

  • 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.