Provides various official and user-released code examples. For code reference, you are welcome to learn thinkphp 3.2.2 integrate the Jpgraph plug-in.
Thinkphp 3.2.2 integrates the Jpgraph plug-in.
1. Download a Jpgraph plug-in package from the Jpgraph website.
2. Copy the Jpgraph plug-in package to the Thinkphp/Library/Vendor/Jpgraph folder (the plug-in is usually put in the Thinkphp extension folder)
// Drawing case
Public function draw3D (){
Vendor ('jpgraph. char ');
$ Chart = new \ Chart;
$ Title = '3d pie fig'; // title
$ Data = array (20, 27, 45, 75, 90, 10, 20, 40); // data
$ Size = 140; // size
$ Width = 800; // width
$ Height = 500; // height
$ Legend = array ('aaa', 'bbbbbb', 'cccccc', 'ddddd', 'eee', 'ffffff', 'gggggg', 'hhhh '); // description
// $ Chart-> create3dpie ($ title, $ data, $ size, $ height, $ width, $ legend );
$ Title = 'bar fig'; // title
$ Data = array (20, 27, 45, 75, 90, 10, 80,100); // data
$ Size = 140; // size
$ Width = 750; // width
$ Height = 350; // height
$ Legend = array ('aaa', 'bbbbbb', 'cccccc', 'ddddd', 'eee', 'ffffff', 'gggggg', 'hhhh '); // description
$ Chart-> createcolumnar ($ title, $ data, $ size, $ height, $ width, $ legend );
/* $ Title = 'bar fig'; // title
$ Data = array (20, 27, 45, 75, 90, 10, 80,100); // data
$ Size = 140; // size
$ Width = 750; // width
$ Height = 350; // height
$ Legend = array ('aaa', 'bbbbbb', 'cccccc', 'ddddd', 'eee', 'ffffff', 'gggggg', 'hhhh '); // description
$ Chart-> createmonthline ($ title, $ data, $ size, $ height, $ width, $ legend );*/
/* $ Title = 'bar fig'; // title
$ Data = array (20, 27, 45, 75, 90, 10, 80,100); // data
$ Size = 140; // size
$ Width = 750; // width
$ Height = 350; // height
$ Legend = array ('aaa', 'bbbbbb', 'cccccc', 'ddddd', 'eee', 'ffffff', 'gggggg', 'hhhh '); // description
$ Chart-> createring ($ title, $ data, $ size, $ height, $ width, $ legend );
$ Title = 'bar business fig'; // title
$ Subtitle = 'August 11 ';
$ Data = array (90,100, 80,100,300,500,100,); // data
$ Size = 140; // size
$ Width = 750; // width
$ Height = 350; // height
$ Legend = array ('zhang San 1', 'zhang San 2', 'zhang San 3', 'zhang San 4', 'zhang San 5', 'zhang San 6', 'zhang San 7 ', 'zhang San 8'); // description
$ Chart-> createhorizoncolumnar ($ title, $ subtitle, $ data, $ size, $ height, $ width, $ legend );
*/
}
For detailed integration methods, see http://www.jb100.net/html/content-28-163-1.html
AD: truly free, domain name + VM + enterprise mailbox = 0 RMB