收藏文章 楼主

php 图表

版块:php   类型:置顶   作者:小绿叶技术博客   查看:1639   回复:1   获赞:0   时间:2022-04-24 20:36:04


php要求:php7.x 版本

进入点击download 进行下载:http://jpgraph.net/download/


帮助手册:http://work.eisc.cn/jpgraph/docs/chunkhtml/index.html


测试:http://work.eisc.cn/cs/txt1.php

条形图帮助文档:http://work.eisc.cn/jpgraph/docs/chunkhtml/ch15s02.html

总览:http://work.eisc.cn/jpgraph/docs/chunkhtml/index.html


<?php 

header("Content-Type:text/html;charset=utf-8");


require_once ('/www/wwwroot/work/jpgraph/src/jpgraph.php');

require_once ('/www/wwwroot/work/jpgraph/src/jpgraph_bar.php');




$datay=array(1000,2000,1900,1800,2200,1300,2001);

 

// Size of graph

$width=900;

$height=700;

 

// Set the basic parameters of the graph

$graph = new Graph($width,$height);

$graph->SetScale('textlin');

 

$top = 60;

$bottom = 30;

$left = 80;

$right = 30;

$graph->Set90AndMargin($left,$right,$top,$bottom);

 

// Nice shadow

$graph->SetShadow();

 

// Setup labels

$lbl = array("韩国ip\n1.1.1.1","美国ip2.2.2.2\nAnderssen","德国ip\n11.22.33.44","Nick\nDavidsson",

"David\nLindquist","Jason\nTait","Lorin\nPersson");

$graph->xaxis->SetTickLabels($lbl);

 

// Label align for X-axis

$graph->xaxis->SetLabelAlign('right','center','right');

 

// Label align for Y-axis

$graph->yaxis->SetLabelAlign('center','bottom');

 

// Titles

$graph->title->Set('小绿叶技术博客攻击扫段攻击防御系统拦截统计');

 

// Create a bar pot

$bplot = new BarPlot($datay);

$bplot->SetFillColor('orange');

$bplot->SetWidth(0.5);

$bplot->SetYMin(1990);

 

$graph->Add($bplot);

 

$graph->Stroke();

?>


提供企业建站服务,免费网防系统,提交信息登录 http://yundun.ddoss.cn 邮箱: proposal@ddoss.cn 
回复列表
默认   热门   正序   倒序

回复:php 图表

头像

用户名:

粉丝数:

签名:

资料 关注 好友 消息