//保存畫布
$graph->Stroke('./test.jpg');
test.php
<?php
require_once '../src/jpgraph.php';
require_once '../src/jpgraph_line.php';
$graph = new Graph(600, 400);
/**
* lin直線
* text文本
* int整數(shù)
* long對數(shù)
* textint
*/
$aAxisType = 'textint';
$graph->SetScale($aAxisType);
//設置統(tǒng)計圖的標題
$graph->title->Set('this is a test');
$data = array(0 => 10, 1 => 20, 2 => 30, 3 => 40, 4 => 50, 5 => 12, 6 => 38, 7 => 55, 8 => 100,
9 => 120, 10 => 30, 11 => 54
);
$linePlot = new LinePlot($data);
//設置圖例
$linePlot->SetLegend('tuli');
//將統(tǒng)計圖添加到畫布上
$graph->Add($linePlot);
//設置統(tǒng)計圖的顏色 一定要在添加到畫布之后再設置
$linePlot->SetColor('red');
//保存畫布
$graph->Stroke('./test.jpg');
?>
最后編輯于 :
?著作權歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者