php 藉助【jpgraph】生成圖表

一、下載php

二、加載spa

include_once dirname(dirname(__FILE__)).'/libraries/src/jpgraph.php';
//散點
include_once dirname(dirname(__FILE__)).'/libraries/src/jpgraph_scatter.php';
$ DATAX = 陣列3 0.5 3 0.7 3 4 6 0.2 6 3 0.5 8 14 8 11 0.1 13 0.7 ; $ DATAY = 陣列20 22 12 13 17 20 16 19 30 3140 43 ; $圖表= 圖形300 200 ; $ graph - > SetScale 'linlin' ; 
 
$圖表- > IMG - > SetMargin 40 40 40 40 ; $ graph - > SetShadow ; $ graph - > title - > Set 一個簡單的散點圖; $ graph - > title - > SetFont FF_FONT1 FS_BOLD ; $ sp1 = new ScatterPlot $ datay $ datax ; 
 
$ graph - > Add $ sp1 ; $ graph - > Stroke ;
相關文章
相關標籤/搜索