1 | <?php // content="text/plain; charset=utf-8" |
---|
2 | require_once ('jpgraph/jpgraph.php'); |
---|
3 | require_once ('jpgraph/jpgraph_scatter.php'); |
---|
4 | |
---|
5 | $datax = array(3.5,3.7,3,4,6.2,6,3.5,8,14,8,11.1,13.7); |
---|
6 | $datay = array(20,22,12,13,17,20,16,19,30,31,40,43); |
---|
7 | $graph = new Graph(300,200); |
---|
8 | $graph->img->SetMargin(40,40,40,40); |
---|
9 | $graph->img->SetAntiAliasing(); |
---|
10 | $graph->SetScale("linlin"); |
---|
11 | $graph->SetShadow(); |
---|
12 | $graph->title->Set("Linked Scatter plot ex1"); |
---|
13 | $graph->title->SetFont(FF_FONT1,FS_BOLD); |
---|
14 | |
---|
15 | $sp1 = new ScatterPlot($datay,$datax); |
---|
16 | $sp1->SetLinkPoints(true,"red",2); |
---|
17 | $sp1->mark->SetType(MARK_FILLEDCIRCLE); |
---|
18 | $sp1->mark->SetFillColor("navy"); |
---|
19 | $sp1->mark->SetWidth(3); |
---|
20 | |
---|
21 | $graph->Add($sp1); |
---|
22 | $graph->Stroke(); |
---|
23 | |
---|
24 | ?> |
---|
25 | |
---|
26 | |
---|