27 lines
774 B
PHP
27 lines
774 B
PHP
<?php
|
|
require_once 'jpgraph/jpgraph.php';
|
|
require_once 'jpgraph/jpgraph_line.php';
|
|
|
|
$datay = array(83,57,93,112,142,112,89,125,69,105,118,75);
|
|
$graph = new Graph(600, 300,'auto');
|
|
$graph->img->SetMargin(50,40,30,40);
|
|
$graph->img->SetAntiAliasing();
|
|
$graph->SetScale('textlin');
|
|
$graph->SetShadow();
|
|
|
|
$title = '2020年轿车的月销量统计';
|
|
$graph->tabtitle->Set($title);
|
|
$graph->tabtitle->SetFont(FF_SIMSUN,FS_BOLD);
|
|
|
|
$a = array('1月','2月','3月','4月','5月','6月','7月','8月','9月','10月', '11月','12月');
|
|
$graph->xaxis->SetTickLabels($a);
|
|
$graph->xaxis->SetFont(FF_SIMSUN);
|
|
$graph->xgrid->Show();
|
|
$linePlot = new LinePlot($datay);
|
|
$linePlot->mark->SetType(MARK_IMG,'images/car.gif',0.8);
|
|
|
|
|
|
$linePlot->SetCenter();
|
|
$graph->Add($linePlot);
|
|
$graph->Stroke();
|