php报表之jpgraph柱状图实例
jpgraph是php中一个非常非常强大的第三方报表工具,据说能完成一切你想要的图形… 新手初识jpgraph肯定会遇到各种各样的问题,比如乱码什么的,本案例是jpgraph3.0.7制作,也经过本人的多次实验,解决乱码问题 <?php $datay=array(); //纵坐标数据 $datax=array(); //横坐标数据 foreach ($usernums as $key => $value){ require_once (‘jpgraph-3.0.7/jpgraph/jpgraph.php’); // Create the graph. These two calls are always required $graph->xaxis->SetTickLabels($datax); $graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,10); $graph->yaxis->scale->SetGrace(20); // Adjust the margin a bit to make more room for titles // Create a bar pot // Adjust fill color // Setup the titles $graph->xaxis->title->SetFont(FF_SIMSUN,FS_BOLD); // Display the graph ?> 效果图:
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |