1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
<?php
require_once "/var/www/application/jpgraph2/jpgraph.php";
require_once "/var/www/application/jpgraph2/jpgraph_line.php";
$ydata = array(11,3,8,12,5,1,9,13,5,7);
$graph = new Graph(600,400,"auto");
$graph->SetScale("textlin");
$lineplot=new LinePlot($ydata);
$graph->Add($lineplot);
$graph->img->SetMargin(40,20,20,40);
$graph->img->SetAntiAliasing("white");
$graph->title->SetFont(FF_CHINESE,FS_NORMAL, 14);
$graph->title->Set('中文');
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
$lineplot->SetColor("blue");
$lineplot->SetWeight(5);
$graph->yaxis->SetColor("red");
$graph->Stroke();
?> |
Partager