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
 * This work is hereby released into the Public Domain.
4
 * To view a copy of the public domain dedication,
5
 * visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
6
 * Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
7
 *
8
 */
9
 
10
require_once "../LinePlot.class.php";
11
 
12
$graph = new Graph(375, 200);
13
 
14
// Set title
15
$graph->title->set('Star marks');
16
$graph->title->setFont(new Tuffy(12));
17
$graph->title->setColor(new DarkRed);
18
 
19
$plot = new LinePlot(array(5, 3, 4, 7, 6, 5, 8, 4, 7));
20
 
21
// Change plot size and position
22
$plot->setSize(0.76, 1);
23
$plot->setCenter(0.38, 0.5);
24
 
25
$plot->setPadding(30, 15, 38, 25);
26
$plot->setColor(new Orange());
27
$plot->setFillColor(new LightOrange(80));
28
 
29
// Change grid style
30
$plot->grid->setType(Line::DASHED);
31
 
32
// Add customized  marks
33
$plot->mark->setType(Mark::STAR);
34
$plot->mark->setFill(new MidRed);
35
$plot->mark->setSize(6);
36
 
37
// Change legend
38
$plot->legend->setPosition(1, 0.5);
39
$plot->legend->setAlign(Legend::LEFT);
40
$plot->legend->shadow->smooth(TRUE);
41
 
42
$plot->legend->add($plot, 'My line', Legend::MARK);
43
 
44
$graph->add($plot);
45
$graph->draw();
46
?>