带基准线折线图php代码

带基准线折线图php代码

ID:20191713

大小:31.00 KB

页数:7页

时间:2018-10-10

带基准线折线图php代码_第1页
带基准线折线图php代码_第2页
带基准线折线图php代码_第3页
带基准线折线图php代码_第4页
带基准线折线图php代码_第5页
资源描述:

《带基准线折线图php代码》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、带基准线的折线图php代码/***VoteSystemVersion1.0*================================================*Copy2012*================================================*Author:Lpyuan*Date:2012-4-7*具体代码来自百度文库:http://wenku.baidu.com/view/debf104afe4733687e21aaa3.html:我做了点修改(2013-4-14)*/hea

2、der("Content-Type:image/png");$width=900;//定义画布宽度$height=240;//定义画布高度$right=20;//定义坐标系距画布右侧距离$left=20;//定义坐标系距画布左侧距离$top=70;//定义坐标系距画布上侧距离$buttom=20;//定义坐标系距画布下侧距离$up=79;//上基准线的值$down=33;//下基准线的值$target=46;//标准线的值$x=array();//定义x坐标空数组$y=array();//定义y坐标空数组$data=arr

3、ay(10,5,30,40,25,80,5,30,40,25,46);//定义所绘制数据数组$name=array('a','b','c','d','e','f','b','c','d','e','f');//定义横坐标的坐标标签foreach($dataas$k=>$v){//获取$data中最大值if($k==0&&$v!=''){$min=$v;$max=$v;}elseif($v!=''){$min=min($min,$v);$max=max($max,$v);}if($v==''){$kong=$k;}}$ima

4、ge=imagecreatetruecolor($width,$height);//---------------------//$white=imagecolorallocate($image,255,255,255);//定义真彩画布及颜色值//$black=imagecolorallocate($image,10,10,10);$blue=imagecolorallocate($image,0,0,255);$red=imagecolorallocate($image,255,0,0);//-------------

5、--------//$yellow=imagecolorallocate($image,255,170,0);$green=imagecolorallocate($image,79,144,30);imagefill($image,0,0,$white);//用白色填充画布//画横坐标imageline($image,$left,$height-$buttom,$width-$right,$height-$buttom,$black);//画纵坐标imageline($image,$left,$top,$left,$hei

6、ght-$buttom,$black);//画箭头imageline($image,$width-$right,$height-$buttom,($width-$right)-8,$height-$buttom-3,$black);imageline($image,$width-$right,$height-$buttom,($width-$right)-8,$height-$buttom+3,$black);imageline($image,$left-3,$top+5,$left,$top,$black);imagel

7、ine($image,$left,$top,$left+3,$top+5,$black);//计算$data数组中每个元素的坐标$unit=($width-$left-$right)/count($data);//定义x轴刻度间隔for($i=0;$i

8、){imageline($image,$left+$i*$unit,$height-$buttom,$left+$i*$unit,$height-$buttom-8,$black);imagestring($image,10,$left+$i*$unit,$height-$buttom,$name[$i

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。