//引入JpGraph类库
include_once dirname(dirname(__FILE__)) . '/lib/JpGraph/src/jpgraph.php' ;
include_once dirname(dirname(__FILE__)) . '/lib/JpGraph/src/jpgraph_line.php' ;
//1.创建画布
$graph = new Graph(600,400);
//2.设置横纵坐标刻度样式
/*
* lin直线
* text文本
* int整数
* log对数
*textint纵横坐标自由组合
*
*/
$aAxisType = 'textint';
$graph->SetScale($aAxisType);
//3.设置统计图的标题
$graph->title->Set('this is a test');
//设置数据
$data = array(0=>12,1=>20,2=>30,3=>40,4=>50,5=>12,6=>38,7=>55,8=>100,9=>120,10=>30,11=>54);
//$data = array(20,30,40,50,12,38,55,10,21,20);
//4.得到LinePlot对象
$linePlot = new LinePlot($data);
//5.设置图例·
$linePlot->SetLegend('tuli');
//6.将统计图添加到画布上
$graph->Add($linePlot);
$graph->Stroke();
include_once dirname(dirname(__FILE__)) . '/lib/JpGraph/src/jpgraph.php' ;
include_once dirname(dirname(__FILE__)) . '/lib/JpGraph/src/jpgraph_line.php' ;
//1.创建画布
$graph = new Graph(600,400);
//2.设置横纵坐标刻度样式
/*
* lin直线
* text文本
* int整数
* log对数
*textint纵横坐标自由组合
*
*/
$aAxisType = 'textint';
$graph->SetScale($aAxisType);
//3.设置统计图的标题
$graph->title->Set('this is a test');
//设置数据
$data = array(0=>12,1=>20,2=>30,3=>40,4=>50,5=>12,6=>38,7=>55,8=>100,9=>120,10=>30,11=>54);
//$data = array(20,30,40,50,12,38,55,10,21,20);
//4.得到LinePlot对象
$linePlot = new LinePlot($data);
//5.设置图例·
$linePlot->SetLegend('tuli');
//6.将统计图添加到画布上
$graph->Add($linePlot);
$graph->Stroke();