@@ -27,13 +27,13 @@ |
||
| 27 | 27 | $graph->scale->day->SetStyle(DAYSTYLE_SHORTDAYDATE3); |
| 28 | 28 | |
| 29 | 29 | $data = array( |
| 30 | - array(0," Label 1", "2001-01-26 04:00","2001-01-26 14:00"), |
|
| 31 | - array(1," Label 2", "2001-01-26 10:00","2001-01-26 18:00"), |
|
| 32 | - array(2," Label 3", "2001-01-26","2001-01-27 10:00") |
|
| 30 | + array(0, " Label 1", "2001-01-26 04:00", "2001-01-26 14:00"), |
|
| 31 | + array(1, " Label 2", "2001-01-26 10:00", "2001-01-26 18:00"), |
|
| 32 | + array(2, " Label 3", "2001-01-26", "2001-01-27 10:00") |
|
| 33 | 33 | ); |
| 34 | 34 | |
| 35 | 35 | |
| 36 | -for ($i=0; $i < count($data); ++$i) { |
|
| 36 | +for ($i = 0; $i < count($data); ++$i) { |
|
| 37 | 37 | $bar = new GanttBar($data[$i][0], $data[$i][1], $data[$i][2], $data[$i][3], "[5%]", 10); |
| 38 | 38 | if (count($data[$i]) > 4) { |
| 39 | 39 | $bar->title->SetFont($data[$i][4], $data[$i][5], $data[$i][6]); |
@@ -25,18 +25,18 @@ |
||
| 25 | 25 | |
| 26 | 26 | |
| 27 | 27 | $data = array( |
| 28 | - array(0,"Group 1\tJohan", "2002-1-23","2002-01-28",FF_FONT1,FS_BOLD,8), |
|
| 29 | - array(1," Label 2", "2001-10-26","2001-11-16"), |
|
| 30 | - array(2," Label 3", "2001-11-30","2001-12-01"), |
|
| 31 | - array(4,"Group 2", "2001-11-30","2001-12-22",FF_FONT1,FS_BOLD,8), |
|
| 32 | - array(5," Label 4", "2001-11-30","2001-12-1"), |
|
| 33 | - array(6," Label 5", "2001-12-6","2001-12-8"), |
|
| 34 | - array(8," Label 8", "2001-11-30","2002-01-02") |
|
| 28 | + array(0, "Group 1\tJohan", "2002-1-23", "2002-01-28", FF_FONT1, FS_BOLD, 8), |
|
| 29 | + array(1, " Label 2", "2001-10-26", "2001-11-16"), |
|
| 30 | + array(2, " Label 3", "2001-11-30", "2001-12-01"), |
|
| 31 | + array(4, "Group 2", "2001-11-30", "2001-12-22", FF_FONT1, FS_BOLD, 8), |
|
| 32 | + array(5, " Label 4", "2001-11-30", "2001-12-1"), |
|
| 33 | + array(6, " Label 5", "2001-12-6", "2001-12-8"), |
|
| 34 | + array(8, " Label 8", "2001-11-30", "2002-01-02") |
|
| 35 | 35 | ); |
| 36 | 36 | |
| 37 | 37 | |
| 38 | 38 | // make up some fictionary activity bars |
| 39 | -for ($i=0; $i < count($data); ++$i) { |
|
| 39 | +for ($i = 0; $i < count($data); ++$i) { |
|
| 40 | 40 | $bar = new GanttBar($data[$i][0], $data[$i][1], $data[$i][2], $data[$i][3], "[5%]", 10); |
| 41 | 41 | if (count($data[$i]) > 4) { |
| 42 | 42 | $bar->title->SetFont($data[$i][4], $data[$i][5], $data[$i][6]); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | // Setup activity info |
| 36 | 36 | |
| 37 | 37 | // For the titles we also add a minimum width of 100 pixels for the Task name column |
| 38 | -$graph->scale->actinfo->SetColTitles(array('Name','Duration','Start','Finish'), array(100)); |
|
| 38 | +$graph->scale->actinfo->SetColTitles(array('Name', 'Duration', 'Start', 'Finish'), array(100)); |
|
| 39 | 39 | $graph->scale->actinfo->SetBackgroundColor('green:[email protected]'); |
| 40 | 40 | $graph->scale->actinfo->SetFont(FF_ARIAL, FS_NORMAL, 10); |
| 41 | 41 | $graph->scale->actinfo->vgrid->SetStyle('solid'); |
@@ -43,16 +43,16 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | // Data for our example activities |
| 45 | 45 | $data = array( |
| 46 | - array(0,array("Pre-study","102 days","23 Nov '01","1 Mar '02") |
|
| 47 | - , "2001-11-23","2002-03-1",FF_ARIAL,FS_NORMAL,8), |
|
| 48 | - array(1,array("Prototype","21 days","26 Oct '01","16 Nov '01"), |
|
| 49 | - "2001-10-26","2001-11-16",FF_ARIAL,FS_NORMAL,8), |
|
| 50 | - array(2,array("Report","12 days","1 Mar '02","13 Mar '02"), |
|
| 51 | - "2002-03-01","2002-03-13",FF_ARIAL,FS_NORMAL,8) |
|
| 46 | + array(0, array("Pre-study", "102 days", "23 Nov '01", "1 Mar '02") |
|
| 47 | + , "2001-11-23", "2002-03-1", FF_ARIAL, FS_NORMAL, 8), |
|
| 48 | + array(1, array("Prototype", "21 days", "26 Oct '01", "16 Nov '01"), |
|
| 49 | + "2001-10-26", "2001-11-16", FF_ARIAL, FS_NORMAL, 8), |
|
| 50 | + array(2, array("Report", "12 days", "1 Mar '02", "13 Mar '02"), |
|
| 51 | + "2002-03-01", "2002-03-13", FF_ARIAL, FS_NORMAL, 8) |
|
| 52 | 52 | ); |
| 53 | 53 | |
| 54 | 54 | // Create the bars and add them to the gantt chart |
| 55 | -for ($i=0; $i < count($data); ++$i) { |
|
| 55 | +for ($i = 0; $i < count($data); ++$i) { |
|
| 56 | 56 | $bar = new GanttBar($data[$i][0], $data[$i][1], $data[$i][2], $data[$i][3], "[50%]", 10); |
| 57 | 57 | if (count($data[$i]) > 4) { |
| 58 | 58 | $bar->title->SetFont($data[$i][4], $data[$i][5], $data[$i][6]); |
@@ -7,10 +7,10 @@ |
||
| 7 | 7 | // The data for the graphs |
| 8 | 8 | // |
| 9 | 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') ); |
|
| 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 | 14 | |
| 15 | 15 | // Create the basic graph |
| 16 | 16 | $graph = new GanttGraph(); |
@@ -7,17 +7,17 @@ |
||
| 7 | 7 | // The data for the graphs |
| 8 | 8 | // |
| 9 | 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-16",''), |
|
| 12 | - array(2,ACTYPE_NORMAL, " Label 3", "2001-11-20","2001-11-22",''), |
|
| 13 | - array(3,ACTYPE_MILESTONE," Phase 1 Done", "2001-11-23",'M2') ); |
|
| 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-16", ''), |
|
| 12 | + array(2, ACTYPE_NORMAL, " Label 3", "2001-11-20", "2001-11-22", ''), |
|
| 13 | + array(3, ACTYPE_MILESTONE, " Phase 1 Done", "2001-11-23", 'M2') ); |
|
| 14 | 14 | |
| 15 | 15 | // The constrains between the activities |
| 16 | 16 | //$constrains = array(array(1,2,CONSTRAIN_ENDSTART), |
| 17 | 17 | // array(2,3,CONSTRAIN_STARTSTART)); |
| 18 | 18 | $constrains = array(); |
| 19 | 19 | |
| 20 | -$progress = array(array(1,0.4)); |
|
| 20 | +$progress = array(array(1, 0.4)); |
|
| 21 | 21 | |
| 22 | 22 | // Create the basic graph |
| 23 | 23 | $graph = new GanttGraph(); |
@@ -15,32 +15,32 @@ discard block |
||
| 15 | 15 | $graph->title->SetFont(FF_VERDANA, FS_BOLD, 14); |
| 16 | 16 | |
| 17 | 17 | // Show three headers |
| 18 | -$graph->ShowHeaders(GANTT_HDAY | GANTT_HMONTH| GANTT_HYEAR); |
|
| 18 | +$graph->ShowHeaders(GANTT_HDAY | GANTT_HMONTH | GANTT_HYEAR); |
|
| 19 | 19 | |
| 20 | 20 | // Set the column headers and font |
| 21 | -$graph->scale->actinfo->SetColTitles(array('Name','Start','End'), array(100)); |
|
| 21 | +$graph->scale->actinfo->SetColTitles(array('Name', 'Start', 'End'), array(100)); |
|
| 22 | 22 | $graph->scale->actinfo->SetFont(FF_ARIAL, FS_BOLD, 11); |
| 23 | 23 | |
| 24 | 24 | // Some "dummy" data to be dsiplayed |
| 25 | 25 | $data = array( |
| 26 | - array(0,'Group 1', '2001-11-27','2001-12-05'), |
|
| 27 | - array(1,' Activity 1', '2001-11-27','2001-11-29'), |
|
| 28 | - array(2,' Activity 2', '2001-11-28','2001-12-05'), |
|
| 29 | - array(3,'Group 2', '2001-11-29','2001-12-10'), |
|
| 30 | - array(4,' Activity 1', '2001-11-29','2001-12-03'), |
|
| 31 | - array(5,' Activity 2', '2001-12-01','2001-12-10'), |
|
| 26 | + array(0, 'Group 1', '2001-11-27', '2001-12-05'), |
|
| 27 | + array(1, ' Activity 1', '2001-11-27', '2001-11-29'), |
|
| 28 | + array(2, ' Activity 2', '2001-11-28', '2001-12-05'), |
|
| 29 | + array(3, 'Group 2', '2001-11-29', '2001-12-10'), |
|
| 30 | + array(4, ' Activity 1', '2001-11-29', '2001-12-03'), |
|
| 31 | + array(5, ' Activity 2', '2001-12-01', '2001-12-10'), |
|
| 32 | 32 | |
| 33 | 33 | ); |
| 34 | 34 | |
| 35 | 35 | // Format and add the Gantt bars to the chart |
| 36 | 36 | $n = count($data); |
| 37 | -for ($i=0; $i < $n; ++$i) { |
|
| 37 | +for ($i = 0; $i < $n; ++$i) { |
|
| 38 | 38 | if ($i === 0 || $i === 3) { |
| 39 | 39 | // Format the group bars |
| 40 | - $bar = new GanttBar($data[$i][0], array($data[$i][1],$data[$i][2],$data[$i][3]), $data[$i][2], $data[$i][3], '', 0.35); |
|
| 40 | + $bar = new GanttBar($data[$i][0], array($data[$i][1], $data[$i][2], $data[$i][3]), $data[$i][2], $data[$i][3], '', 0.35); |
|
| 41 | 41 | |
| 42 | 42 | // For each group make the name bold but keep the dates as the default font |
| 43 | - $bar->title->SetColumnFonts(array(array(FF_ARIAL,FS_BOLD,11))); |
|
| 43 | + $bar->title->SetColumnFonts(array(array(FF_ARIAL, FS_BOLD, 11))); |
|
| 44 | 44 | |
| 45 | 45 | // Add group markers |
| 46 | 46 | $bar->leftMark->SetType(MARK_LEFTTRIANGLE); |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $bar->SetPattern(BAND_SOLID, 'black'); |
| 52 | 52 | } else { |
| 53 | 53 | // Format the activity bars |
| 54 | - $bar = new GanttBar($data[$i][0], array($data[$i][1],$data[$i][2],$data[$i][3]), $data[$i][2], $data[$i][3], '', 0.45); |
|
| 54 | + $bar = new GanttBar($data[$i][0], array($data[$i][1], $data[$i][2], $data[$i][3]), $data[$i][2], $data[$i][3], '', 0.45); |
|
| 55 | 55 | $bar->SetPattern(BAND_RDIAG, 'black'); |
| 56 | 56 | $bar->SetFillColor('orange'); |
| 57 | 57 | } |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | $graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY); |
| 18 | 18 | $graph->scale->week->SetFont(FF_FONT1); |
| 19 | 19 | |
| 20 | -$graph->Add(array($bar1,$bar2)); |
|
| 20 | +$graph->Add(array($bar1, $bar2)); |
|
| 21 | 21 | |
| 22 | 22 | // And stroke |
| 23 | 23 | $graph->StrokeCSIM(); |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | // For the titles we also add a minimum width of 100 pixels for the Task name column |
| 32 | 32 | $graph->scale->actinfo->SetColTitles( |
| 33 | - array('Name','Duration','Start','Finish'), array(100)); |
|
| 33 | + array('Name', 'Duration', 'Start', 'Finish'), array(100)); |
|
| 34 | 34 | $graph->scale->actinfo->SetBackgroundColor('green:[email protected]'); |
| 35 | 35 | $graph->scale->actinfo->SetFont(FF_ARIAL, FS_NORMAL, 10); |
| 36 | 36 | $graph->scale->actinfo->vgrid->SetStyle('solid'); |
@@ -38,16 +38,16 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | // Data for our example activities |
| 40 | 40 | $data = array( |
| 41 | - array(0,array("Pre-study","102 days","23 Nov '01","1 Mar '02") |
|
| 42 | - , "2001-11-23","2002-03-1",FF_ARIAL,FS_NORMAL,8), |
|
| 43 | - array(1,array("Prototype","21 days","26 Oct '01","16 Nov '01"), |
|
| 44 | - "2001-10-26","2001-11-16",FF_ARIAL,FS_NORMAL,8), |
|
| 45 | - array(2,array("Report","12 days","1 Mar '02","13 Mar '02"), |
|
| 46 | - "2002-03-01","2002-03-13",FF_ARIAL,FS_NORMAL,8) |
|
| 41 | + array(0, array("Pre-study", "102 days", "23 Nov '01", "1 Mar '02") |
|
| 42 | + , "2001-11-23", "2002-03-1", FF_ARIAL, FS_NORMAL, 8), |
|
| 43 | + array(1, array("Prototype", "21 days", "26 Oct '01", "16 Nov '01"), |
|
| 44 | + "2001-10-26", "2001-11-16", FF_ARIAL, FS_NORMAL, 8), |
|
| 45 | + array(2, array("Report", "12 days", "1 Mar '02", "13 Mar '02"), |
|
| 46 | + "2002-03-01", "2002-03-13", FF_ARIAL, FS_NORMAL, 8) |
|
| 47 | 47 | ); |
| 48 | 48 | |
| 49 | 49 | // Create the bars and add them to the gantt chart |
| 50 | -for ($i=0; $i < count($data); ++$i) { |
|
| 50 | +for ($i = 0; $i < count($data); ++$i) { |
|
| 51 | 51 | $bar = new GanttBar($data[$i][0], $data[$i][1], $data[$i][2], $data[$i][3], "[50%]", 10); |
| 52 | 52 | if (count($data[$i]) > 4) { |
| 53 | 53 | $bar->title->SetFont($data[$i][4], $data[$i][5], $data[$i][6]); |
@@ -5,10 +5,10 @@ discard block |
||
| 5 | 5 | |
| 6 | 6 | // Some sample Gantt data |
| 7 | 7 | $data = array( |
| 8 | - array(0,array("Group 1","345 days","2004-03-01","2004-05-05"), "2001-11-27 10:00","2001-11-27 14:00",FF_FONT2,FS_NORMAL,0), |
|
| 9 | - array(1,array(" Label one",' 122,5 days',' 2004-03-01',' 2003-05-05','MJ'), "2001-11-27 16:00","2001-11-27 18:00"), |
|
| 10 | - array(2," Label two", "2001-11-27","2001-11-27 10:00"), |
|
| 11 | - array(3," Label three", "2001-11-27","2001-11-27 08:00") |
|
| 8 | + array(0, array("Group 1", "345 days", "2004-03-01", "2004-05-05"), "2001-11-27 10:00", "2001-11-27 14:00", FF_FONT2, FS_NORMAL, 0), |
|
| 9 | + array(1, array(" Label one", ' 122,5 days', ' 2004-03-01', ' 2003-05-05', 'MJ'), "2001-11-27 16:00", "2001-11-27 18:00"), |
|
| 10 | + array(2, " Label two", "2001-11-27", "2001-11-27 10:00"), |
|
| 11 | + array(3, " Label three", "2001-11-27", "2001-11-27 08:00") |
|
| 12 | 12 | ); |
| 13 | 13 | |
| 14 | 14 | |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | // We want to have the following titles in our columns |
| 24 | 24 | // describing each activity |
| 25 | 25 | $graph->scale->actinfo->SetColTitles( |
| 26 | - array('Act','Duration','Start','Finish','Resp'));//,array(100,70,70,70)); |
|
| 26 | + array('Act', 'Duration', 'Start', 'Finish', 'Resp')); //,array(100,70,70,70)); |
|
| 27 | 27 | |
| 28 | 28 | // Uncomment the following line if you don't want the 3D look |
| 29 | 29 | // in the columns headers |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | $graph->title->SetFont(FF_VERDANA, FS_BOLD, 14); |
| 69 | 69 | |
| 70 | 70 | |
| 71 | -for ($i=0; $i < count($data); ++$i) { |
|
| 71 | +for ($i = 0; $i < count($data); ++$i) { |
|
| 72 | 72 | $bar = new GanttBar($data[$i][0], $data[$i][1], $data[$i][2], $data[$i][3]); |
| 73 | 73 | if (count($data[$i]) > 4) { |
| 74 | 74 | $bar->title->SetFont($data[$i][4], $data[$i][5], $data[$i][6]); |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | |
| 82 | 82 | //$vline = new GanttVLine("2001-11-27");//d=1006858800, |
| 83 | -$vline = new GanttVLine("2001-11-27 9:00");//d=1006858800, |
|
| 83 | +$vline = new GanttVLine("2001-11-27 9:00"); //d=1006858800, |
|
| 84 | 84 | $vline->SetWeight(5); |
| 85 | 85 | $vline->SetDayOffset(0); |
| 86 | 86 | $vline->title->Set("27/11 9:00"); |