[JpGraph]③--输出和保存画布

//保存画布
$graph->Stroke('./test.jpg');

test.php

SetScale($aAxisType);
//设置统计图的标题
$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');
//将统计图添加到画布上
$graph->Add($linePlot);
//设置统计图的颜色 一定要在添加到画布之后再设置
$linePlot->SetColor('red');

//保存画布
$graph->Stroke('./test.jpg');


?>
[JpGraph]③--输出和保存画布_第1张图片
Paste_Image.png

你可能感兴趣的:([JpGraph]③--输出和保存画布)