Subversion Repositories Applications.gtt

Rev

Rev 61 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
60 jpm 1
<?php
2
 
3
require_once "../ScatterPlot.class.php";
4
 
5
$graph = new Graph(400, 400);
6
 
7
$center = 5;
8
 
9
$x = array();
10
$y = array();
11
 
12
for($i = 0; $i <= 30; $i++) {
13
	$rad = ($i / 30) * 2 * M_PI;
14
	$x[] = $center + cos($rad) * $center;
15
	$y[] = $center + sin($rad) * $center;
16
}
17
 
18
$plot = new ScatterPlot($y, $x);
19
$plot->setBackgroundColor(new VeryLightGray);
20
$plot->setPadding(30, 30, 30, 30);
21
$plot->setSpace(5, 5, 5, 5);
22
 
23
$plot->link(TRUE, new DarkGreen);
24
 
25
$plot->mark->setFill(new DarkOrange);
26
$plot->mark->setType(Mark::SQUARE, 4);
27
 
28
$plot->setXAxis(Plot::BOTH);
29
$plot->setXAxisZero(FALSE);
30
$plot->setYAxis(Plot::BOTH);
31
 
32
$plot->legend->add($plot, 'A circle', Legend::MARK);
33
$plot->legend->setPosition(0.5, 0.5);
34
$plot->legend->setAlign(Legend::CENTER, Legend::MIDDLE);
35
 
36
$graph->add($plot);
37
$graph->draw();
38
 
39
?>