最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

php使用Jpgraph繪制復(fù)雜X-Y坐標(biāo)圖的方法

 更新時(shí)間:2015年06月10日 15:36:43   作者:zhuzhao  
這篇文章主要介紹了php使用Jpgraph繪制復(fù)雜X-Y坐標(biāo)圖的方法,通過(guò)設(shè)置圖像陰影、邊距、字體、顏色、曲線等實(shí)現(xiàn)Jpgraph繪制復(fù)雜坐標(biāo)圖的功能,非常簡(jiǎn)單實(shí)用,需要的朋友可以參考下

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

<?php 
include ("src/jpgraph.php"); 
include ("src/jpgraph_line.php"); 
$data1 = array(19,23,34,38,45,67,71,78,85,87,90,96); //第一條曲線的數(shù)組 
$data2 = array(523,634,371,278,685,587,490,256,398,545,367,577); //第二條曲線的數(shù)組 
$graph = new Graph(400,300); //創(chuàng)建新的Graph對(duì)象 
$graph->SetScale("textlin"); 
$graph->SetY2Scale("lin"); 
$graph->SetShadow(); //設(shè)置圖像的陰影樣式 
$graph->img->SetMargin(40,50,20,70); //設(shè)置圖像邊距 
$graph->title->Set("年度收支表"); //設(shè)置圖像標(biāo)題 
$lineplot1=new LinePlot($data1); //創(chuàng)建設(shè)置兩條曲線對(duì)象 
$lineplot2=new LinePlot($data2); 
$graph->Add($lineplot1); //將曲線放置到圖像上 
$graph->AddY2($lineplot2); 
$graph->xaxis->title->Set("月份"); //設(shè)置坐標(biāo)軸名稱 
$graph->yaxis->title->Set("兆美元"); 
$graph->y2axis->title->Set("兆美元"); 
$graph->title->SetFont(FF_SIMSUN,FS_BOLD); //設(shè)置字體 
$graph->yaxis->title->SetFont(FF_SIMSUN,FS_BOLD); 
$graph->y2axis->title->SetFont(FF_SIMSUN,FS_BOLD); 
$graph->xaxis->title->SetFont(FF_SIMSUN,FS_BOLD); 
$lineplot1->SetColor("red"); //設(shè)置顏色 
$lineplot2->SetColor("blue"); 
$lineplot1->SetLegend("Cost Amount"); //設(shè)置圖例名稱 
$lineplot2->SetLegend("Revenue Amount"); 
$graph->legend->SetLayout(LEGEND_HOR); //設(shè)置圖例樣式和位置 
$graph->legend->Pos(0.4,0.95,"center","bottom"); 
$graph->Stroke(); //輸出圖像 
?>

運(yùn)行效果如下圖所示:

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

相關(guān)文章

最新評(píng)論

明光市| 崇义县| 博爱县| 富蕴县| 庆阳市| 庆阳市| 龙陵县| 大渡口区| 大埔县| 富锦市| 鹿泉市| 新田县| 察隅县| 秭归县| 新乡县| 沙雅县| 衡阳市| 鄂尔多斯市| 偃师市| 梧州市| 北京市| 常山县| 建水县| 安远县| 普定县| 灯塔市| 南京市| 中牟县| 武汉市| 普安县| 思南县| 临清市| 浦城县| 汾西县| 呼伦贝尔市| 定陶县| 万全县| 龙井市| 五河县| 于田县| 安阳县|