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