欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

php使用Jpgraph繪制簡單X-Y坐標(biāo)圖的方法

 更新時間:2015年06月10日 15:23:59   作者:zhuzhao  
這篇文章主要介紹了php使用Jpgraph繪制簡單X-Y坐標(biāo)圖的方法,實例分析了Jpgraph繪制坐標(biāo)圖及繪制曲線的相關(guān)技巧,需要的朋友可以參考下

本文實例講述了php使用Jpgraph繪制簡單X-Y坐標(biāo)圖的方法。分享給大家供大家參考。具體實現(xiàn)方法如下:

<?php 
include ("src/jpgraph.php"); 
include ("src/jpgraph_line.php"); 
//將要用于圖表創(chuàng)建的數(shù)據(jù)存放在數(shù)組中 
$data = array(19,23,34,38,45,67,71,78,85,87,90,96); 
$graph = new Graph(400,300); //創(chuàng)建新的Graph對象 
$graph->SetScale("textlin"); //設(shè)置刻度樣式 
$graph->img->SetMargin(30,30,80,30); //設(shè)置圖表邊界 
$graph->title->Set("Year to Date Cost"); //設(shè)置圖表標(biāo)題 
// Create the linear plot 
$lineplot=new LinePlot($data); // 創(chuàng)建新的LinePlot對象 
$lineplot->SetLegend("Amount(M dollars)"); //設(shè)置圖例文字 
$lineplot->SetColor("red"); // 設(shè)置曲線的顏色 
// Add the plot to the graph 
$graph->Add($lineplot); //在統(tǒng)計圖上繪制曲線 
// Display the graph 
$graph->Stroke(); //輸出圖像 
?>

運行后效果圖如下:

希望本文所述對大家的php程序設(shè)計有所幫助。

相關(guān)文章

最新評論