[42] | 1 | <?php // content="text/plain; charset=utf-8"
|
---|
| 2 | // Gantt example
|
---|
| 3 | require_once ('jpgraph/jpgraph.php');
|
---|
| 4 | require_once ('jpgraph/jpgraph_gantt.php');
|
---|
| 5 |
|
---|
| 6 | //
|
---|
| 7 | // The data for the graphs
|
---|
| 8 | //
|
---|
| 9 | $data = array(
|
---|
| 10 | array(0,ACTYPE_GROUP, "Phase 1", "2001-10-26","2001-11-23",''),
|
---|
| 11 | array(1,ACTYPE_NORMAL, " Label 2", "2001-10-26","2001-11-13",'[KJ]'),
|
---|
| 12 | array(2,ACTYPE_NORMAL, " Label 3", "2001-11-20","2001-11-22",'[EP]'),
|
---|
| 13 | array(3,ACTYPE_MILESTONE," Phase 1 Done", "2001-11-23",'M2') );
|
---|
| 14 |
|
---|
| 15 | // Create the basic graph
|
---|
| 16 | $graph = new GanttGraph();
|
---|
| 17 | $graph->title->Set("Gantt Graph using CreateSimple()");
|
---|
| 18 |
|
---|
| 19 | // Setup scale
|
---|
| 20 | $graph->ShowHeaders(GANTT_HYEAR | GANTT_HMONTH | GANTT_HDAY | GANTT_HWEEK);
|
---|
| 21 | $graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY);
|
---|
| 22 |
|
---|
| 23 | // Add the specified activities
|
---|
| 24 | $graph->CreateSimple($data);
|
---|
| 25 |
|
---|
| 26 | // .. and stroke the graph
|
---|
| 27 | $graph->Stroke();
|
---|
| 28 |
|
---|
| 29 | ?>
|
---|
| 30 |
|
---|
| 31 |
|
---|