1、下载
2、加载
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 ,31,40 ,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 ();