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
$graph->title->set('Impulses');
8
$graph->title->move(0, 30);
9
$graph->shadow->setSize(5);
10
 
11
$y = array();
12
for($i = 0; $i < 60; $i++) {
13
	$y[] = cos($i / 30 * 2 * M_PI) / (1.5 + $i / 15);
14
}
15
 
16
$plot = new ScatterPlot($y);
17
$plot->setBackgroundColor(new VeryLightOrange);
18
$plot->setSpace(5);
19
 
20
// Set impulses
21
$plot->setImpulse(new DarkBlue);
22
 
23
$plot->grid->hideVertical();
24
 
25
// Hide ticks
26
$plot->xAxis->hideTicks();
27
 
28
// Change labels interval
29
$plot->xAxis->label->setInterval(5);
30
 
31
$plot->mark->setType(Mark::SQUARE);
32
$plot->mark->setSize(4);
33
 
34
$graph->add($plot);
35
$graph->draw();
36
 
37
?>