Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
include ("../jpgraph.php");
3
include ("../jpgraph_scatter.php");
4
 
5
 
6
// Make a circle with a scatterplot
7
$steps=16;
8
for($i=0; $i<$steps; ++$i) {
9
	$a=2*M_PI/$steps*$i;
10
	$datax[$i]=cos($a);
11
	$datay[$i]=sin($a);
12
}
13
 
14
$graph = new Graph(350,230,"auto");
15
$graph->SetScale("linlin");
16
$graph->SetShadow();
17
$graph->SetAxisStyle(AXSTYLE_BOXOUT);
18
 
19
$graph->img->SetMargin(50,50,60,40);
20
 
21
$graph->title->Set("Linked scatter plot");
22
$graph->title->SetFont(FF_FONT1,FS_BOLD);
23
$graph->subtitle->Set("(BOXOUT Axis style)");
24
$graph->subtitle->SetFont(FF_FONT1,FS_NORMAL);
25
 
26
 
27
// 10% top and bottom grace
28
$graph->yscale->SetGrace(5,5);
29
$graph->xscale->SetGrace(1,1);
30
 
31
$sp1 = new ScatterPlot($datay,$datax);
32
$sp1->mark->SetType(MARK_FILLEDCIRCLE);
33
$sp1->mark->SetFillColor("red");
34
$sp1->SetColor("blue");
35
 
36
//$sp1->SetWeight(3);
37
$sp1->mark->SetWidth(4);
38
$sp1->SetLinkPoints();
39
 
40
$graph->Add($sp1);
41
 
42
$graph->Stroke();
43
 
44
?>
45
 
46