Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
include ("../jpgraph.php");
3
include ("../jpgraph_gantt.php");
4
 
5
$graph = new GanttGraph(0,0,"auto");
6
$graph->SetBox();
7
$graph->SetShadow();
8
 
9
// Add title and subtitle
10
$graph->title->Set("Example of captions");
11
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
12
$graph->subtitle->Set("(ganttex13.php)");
13
 
14
// Show day, week and month scale
15
$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH);
16
 
17
// Instead of week number show the date for the first day in the week
18
// on the week scale
19
$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY);
20
 
21
// Make the week scale font smaller than the default
22
$graph->scale->week->SetFont(FF_FONT0);
23
 
24
// Use the short name of the month together with a 2 digit year
25
// on the month scale
26
$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR4);
27
$graph->scale->month->SetFontColor("white");
28
$graph->scale->month->SetBackgroundColor("blue");
29
 
30
// 0 % vertical label margin
31
$graph->SetLabelVMarginFactor(1);
32
 
33
// Format the bar for the first activity
34
// ($row,$title,$startdate,$enddate)
35
$activity = new GanttBar(0,"Project","2001-12-21","2002-01-07","[ER,TR]");
36
 
37
// Yellow diagonal line pattern on a red background
38
$activity->SetPattern(BAND_RDIAG,"yellow");
39
$activity->SetFillColor("red");
40
 
41
// Set absolute height
42
$activity->SetHeight(10);
43
 
44
 
45
// Format the bar for the second activity
46
// ($row,$title,$startdate,$enddate)
47
$activity2 = new GanttBar(1,"Project","2001-12-21","2002-01-02","[BO,SW,JC]");
48
 
49
// ADjust font for caption
50
$activity2->caption->SetFont(FF_ARIAL,FS_BOLD);
51
$activity2->caption->SetColor("darkred");
52
 
53
// Yellow diagonal line pattern on a red background
54
$activity2->SetPattern(BAND_RDIAG,"yellow");
55
$activity2->SetFillColor("red");
56
 
57
// Set absolute height
58
$activity2->SetHeight(10);
59
 
60
// Finally add the bar to the graph
61
$graph->Add($activity);
62
$graph->Add($activity2);
63
 
64
// Add a vertical line
65
$vline = new GanttVLine("2001-12-24","Phase 1");
66
$vline->SetDayOffset(0.5);
67
//$graph->Add($vline);
68
 
69
// ... and display it
70
$graph->Stroke();
71
?>