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!