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
require_once "../../LinePlot.class.php";
3
 
4
$graph = new Graph(400, 300);
5
 
6
$graph->setAntiAliasing(TRUE);
7
 
8
$values = array(1, 7, 3, 2.5, 5, -4.5, -5);
9
$plot = new LinePlot($values);
10
$plot->setBackgroundColor(new Color(245, 245, 245));
11
 
12
$plot->hideLine(TRUE);
13
$plot->setFillColor(new Color(180, 180, 180, 75));
14
 
15
$plot->grid->setBackgroundColor(new Color(235, 235, 180, 60));
16
 
17
$plot->yAxis->setLabelPrecision(2);
18
$plot->yAxis->setLabelNumber(6);
19
 
20
$days = array(
21
	'Lundi',
22
	'Mardi',
23
	'Mercredi',
24
	'Jeudi',
25
	'Vendredi',
26
	'Samedi',
27
	'Dimanche'
28
);
29
$plot->xAxis->setLabelText($days);
30
 
31
$plot->setSpace(6, 6, 10, 10);
32
 
33
$plot->mark->setType(Mark::IMAGE);
34
$plot->mark->setImage(new FileImage("smiley.png"));
35
 
36
$plot->label->set($values);
37
$plot->label->move(0, -23);
38
$plot->label->setBackgroundGradient(
39
	new LinearGradient(
40
		new Color(250, 250, 250, 10),
41
		new Color(255, 200, 200, 30),
42
 
43
	)
44
);
45
$plot->label->border->setColor(new Color(20, 20, 20, 20));
46
$plot->label->setPadding(3, 1, 1, 0);
47
 
48
$graph->add($plot);
49
$graph->draw();
50
?>