require_once ("C:xampp\htdocs\jpgraph\jpgraph\jpgraph.php");
require_once ("C:xampp\htdocs\jpgraph\jpgraph\jpgraph_line.php");
$data1 = array(523,634,371,278,685,587,490,256,398,545,367,577);//第一條曲線的陣列
$graph = new Graph(500,300);
$graph->SetScale("textlin");
$graph->SetShadow();
$graph->img->SetMargin(60,30,30,70); //設定影象邊距
$graph->graph_theme = null ; //設定主題為null,否則value->Show(); 無效
$lineplot1=new LinePlot($data1); //建立設定兩條曲線物件
$lineplot1->value->SetColor("red");
$lineplot1->value->Show();
$graph->Add($lineplot1); //將曲線放置到影象上
$graph->title->Set("CDN流量圖"); //設定影象標題
$graph->xaxis->title->Set("月份"); //設定座標軸名稱
$graph->yaxis->title->Set("流 量(Gbits)");
$graph->title->SetMargin(10);
$graph->xaxis->title->SetMargin(10);
$graph->yaxis->title->SetMargin(10);
$graph->title->SetFont(FF_SIMSUN,FS_BOLD); //設定字型
$graph->yaxis->title->SetFont(FF_SIMSUN,FS_BOLD,6);
$graph->xaxis->title->SetFont(FF_SIMSUN,FS_BOLD,6);
$graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth());
$graph->Stroke(); //輸出影象