工作,学习,生活,这里将会有一些记录. 备用域名:http://meisw.wdlinux.cn 注册 | 登陆

jpgraph

<?php
include ("../jpgraph.php");
include ("../jpgraph_line.php");//将要用于图表创建的数据存放在数组中
$data =array(19,23,34,38,45,67,71,78,85,90,96,145);
$graph = new Graph(500,300);                                                    //创建新的Graph对象
$graph->SetScale("textlin");                                                   //设置刻度样式
$graph->img->SetMargin(30,30,80,30);                    //设置图表边界
$graph->title->Set("CDN TrafficTotal");        //设置图表标题
$graph->title->SetColor("blue");
$graph->title->SetMargin(20); // Create the linear plot
$lineplot=new LinePlot($data);              // 创建新的LinePlot对象
$lineplot->SetLegend("Line(Mbits)");   //设置图例文字
$lineplot->SetColor("red");                 // 设置曲线的颜色 // Add the plot to the graph
$graph->Add($lineplot);                     //在统计图上绘制曲线 // Display the graph
$graph->Stroke();                         //输出图像
?>

 

-----------

$graph = new Graph(300,200,"auto");    
$graph->img->SetMargin(40,30,20,40);
$graph->SetScale("textlin");
$graph->SetShadow();

// Create a bar pot
$bplot = new BarPlot($datay);
$bplot->SetFillColor("orange");
$graph->Add($bplot);

// Display the graph
$graph->Stroke();

 

-------------

« 上一篇 | 下一篇 »

Trackbacks

点击获得Trackback地址,Encode: UTF-8

发表评论

评论内容 (必填):