PHP生成条形图的方法
本篇章节讲解PHP生成条形图的方法。分享给大家供大家参考。具体实现方法如下: 代码如下: // now we get the number of values in the array. this will
// tell us how many columns to plot $columns = count($values); // set the height and width of the graph image $width = 300; // Set the amount of space between each column // Get the width of 1 column // set the graph color variables // set the background color of the graph // Calculate the maximum value we are going to plot // loop over the array of columns 100); // write the columns over the background // This gives the columns a little 3d effect // set the correct png headers 运行效果如下图所示: 希望本文所述对大家的PHP程序设计有所帮助。 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |