The script is as follows:
Include ("../Examples/jpgraph. php ");
Include ("../Examples/jpgraph/jpgraph_bar.php ");
$ Datay = array (1, 2, 4); // ordinate data
$ Datax = array (a, B, c, d); // x coordinate data
Foreach ($ usernums as $ key => $ value ){
$ Datay [] = $ value;
$ Datax [] = $ userids [$ key];
}
$ Graph = new Graph (800,600, 'auto', 1 ); // ******** the cache time is 1 minute ************
$ Graph-> SetScale ("textlin ");
$ Graph-> xaxis-> SetTickLabels ($ datax );
$ Graph-> xaxis-> SetFont (FF_VERDANA, FS_NORMAL, 10 );
$ Graph-> xaxis-> SetLabelAngle (30 );
$ Graph-> yaxis-> scale-> SetGrace (20 );
$ Graph-> xaxis-> scale-> SetGrace (20 );
$ Graph-> SetShadow ();
$ Graph-> img-> SetMargin (40, 30, 20, 40 );
$ Bplot = new BarPlot ($ datay );
$ Bplot-> SetFillColor ('Orange ');
$ Bplot-> value-> Show ();
$ Bplot-> value-> SetFont (FF_ARIAL, FS_BOLD, 10 );
$ Bplot-> value-> SetAngle (45 );
$ Bplot-> value-> SetFormat ('% d ');
$ Graph-> Add ($ bplot );
$ Graph-> title-> Set ("cable usage statistics ");
$ Graph-> xaxis-> title-> Set ("Department name ");
$ Graph-> yaxis-> title-> Set ("occupation by the Business Department ");
$ Graph-> xaxis-> title-> SetFont (FF_SIMSUN, FS_BOLD );
$ Graph-> yaxis-> title-> SetFont (FF_SIMSUN, FS_BOLD );
$ Graph-> title-> SetFont (FF_SIMSUN, FS_BOLD );
$ Graph-> Stroke ();
During the first access, a copy image is generated in the cache folder. during 2nd accesses, the size of the generated copy image is 0 bytes, and an error message is displayed during 3rd accesses.
Share:
------ Solution --------------------
Unable to delete cached images?
The file name is empty. how can I delete it?
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.