动态 版块 发帖 消息 我的
小绿叶技术博客
小绿叶技术博客
小绿叶技术Lv154   
php 图表     


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();

?>


 0  已被阅读了1108次  楼主 2022-04-24 20:36:04
回复列表
admin
2F
小绿叶技术Lv154   

 0   2022-04-24 20:56:03  回复

回复: php 图表

guest
登录之后更精彩~
Powered by HadSky 7.12.10
© 2015-2024 PuYueTian
您的IP:34.236.191.0,2024-05-30 07:19:02,Processed in 0.01789 second(s).
Powered by HadSky
小绿叶技术博客