1 | <?php // content="text/plain; charset=utf-8"
|
---|
2 | // Gantt example to create CSIM using CreateSimple()
|
---|
3 |
|
---|
4 | require_once ('jpgraph/jpgraph.php');
|
---|
5 | require_once ('jpgraph/jpgraph_gantt.php');
|
---|
6 |
|
---|
7 | $data = array(
|
---|
8 | array(0,ACTYPE_GROUP, "Phase 1", "2001-10-26","2001-11-23",'',
|
---|
9 | '#1','Go home'),
|
---|
10 | array(1,ACTYPE_NORMAL, " Label 2", "2001-10-26","2001-11-16",'ab,cd',
|
---|
11 | '#2','Go home'),
|
---|
12 | array(2,ACTYPE_NORMAL, " Label 3", "2001-11-20","2001-11-22",'ek',
|
---|
13 | '#3','Go home'),
|
---|
14 | array(3,ACTYPE_MILESTONE," Phase 1 Done", "2001-11-23",'M2',
|
---|
15 | '#4','Go home') );
|
---|
16 |
|
---|
17 | // The constrains between the activities
|
---|
18 | $constrains = array(array(1,2,CONSTRAIN_ENDSTART),
|
---|
19 | array(2,3,CONSTRAIN_STARTSTART));
|
---|
20 |
|
---|
21 | $progress = array(array(1,0.4));
|
---|
22 |
|
---|
23 | $graph = new GanttGraph(500);
|
---|
24 | $graph->title->Set("Example with image map");
|
---|
25 | $graph->ShowHeaders(GANTT_HYEAR | GANTT_HMONTH | GANTT_HDAY | GANTT_HWEEK);
|
---|
26 | $graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY);
|
---|
27 | $graph->scale->week->SetFont(FF_FONT1);
|
---|
28 |
|
---|
29 | $graph->CreateSimple($data,$constrains,$progress);
|
---|
30 |
|
---|
31 | // Add the specified activities
|
---|
32 | //SetupSimpleGantt($graph,$data,$constrains,$progress);
|
---|
33 |
|
---|
34 | // And stroke
|
---|
35 | $graph->StrokeCSIM();
|
---|
36 |
|
---|
37 |
|
---|
38 | ?>
|
---|
39 |
|
---|
40 |
|
---|