Gantt charts

Gantt charts are used to give an easy overview of the extension in time of one or several activities (possible grouped). In addition the gantt chart can show an ordinal relation between one or several activities such as "activity A needs to be finished before activity B can start".

The shape of each activity can also be adjusted as well as color and size. Some of the capabilities of the Gantt module in the library are listed below.

An example of a small Gantt chart is shown in Figure 16.53. A typical small Gantt chart (ganttmonthyearex2.php)

Figure 16.53. A typical small Gantt chart (ganttmonthyearex2.php)

A typical small Gantt chart (ganttmonthyearex2.php)


The remainder of this section will be used to discuss most of the formatting options for Gantt charts.

Note

There is one restrictions of the date scale and that is that it cannot have any "holes" the dates must be continues.

The structure of a Gantt chart

To understand the terminology used for Gantt chart Figure 16.54. Building block of a Gantt chart shows a typical chart with indications of the name of each main building block of the chart.

Figure 16.54. Building block of a Gantt chart

Building block of a Gantt chart


In addition to the specific Gantt formatting that will be discussed in the following sections all the previously explained graph embellishment like the options of adding texts, icons, changing font and color of titles, adding footers etc. are also available for Gantt charts.

A Gantt chart is made up of four distinct areas:

  1. On the left side there is the activity title column.

  2. On the top there is the scale headers (up to six headers may be displayed)

  3. The actual plot area where all the activity Gantt bars and markers are placed

  4. The margin area, where for example the titles are shown

The steps to crate a Gantt charts is similar to creating a cartesian plot. First an instance of the main graph canvas is created (as an instance of class GanttGraph) and then one or more "plots" are created an added to the graph. For Gantt graph the "plots" that can be added are typically

  • Activity bars (we will also use the name Gantt bars as synonym) that indicates the length (and possible progress) of one activity. An activity bar is created as an instance of class GanttBar

  • Milestone marks, this can be thought of as a special activity bar with length = 0 and is often used to indicate a milestone or a deadline in the Gantt chart. A milestone is created as an instance of class Milestone

  • A phase divider, this is a vertical line that can be added at specific dates and is often used to mark then end and beginning of phases i a project. A divider is created as an instance of class GanttVLine (for Gantt Vertical Line)

  • A background pattern for a specific date range, this is often used to indicate holidays, public holidays or periods of special interest in the project

  • An arbitrary icon, this is either a predefined image or one of the built in markers in the library. This is created as an instance of class IconImage

All these objects may be extensively modified in terms of formatting., colors (both fill- and frame color), size, titles, style and patterns etc. All objects have basic default values so it is not strictly speaking necessary to adjust them. However, the basic default values will give the charts a very simple look.

Creating a Gantt graph

In order to create a Gantt graph the module "jpgraph_gantt.php" must be included together with the core module "jpgraph.php"

A Gantt graph is created as an instance of class GanttGraph which inherits much of the same formatting options available for standard x-y graphs, for example titles, backgrounds, adding icons, adding texts and so on.

There is one crucial difference between all the other graph types and Gantt charts and that is the fact that for all other graphs both the height and width of the graph must be specified. For Gantt graphs this is not true.

Gantt graphs can be either

  • fully automatically sized

  • have the width specified but the height automatically determined by the number of activities added to the graph

  • fully specified with both width and height

This means that all the following gantt graph creations are valid

1
2
3
4
5
6
7
8
9
10
<?php
// Fully automatic
$ganttgraph = new GanttGraph();
 
// Semi automatic (automatically determined height)
$ganttgraph = new GanttGraph(800);
 
// Fully manual
$ganttgraph = new GanttGraph(800,500);
?>

Note

If the specified width and height is too small to have room for all the activities specified the activities will be clipped to the specified date range.

The creation of a full Gantt graph follows the now familiar pattern of

  1. Create the graph (as shown above) and specify the overall formatting options (e.g. titles, colors etc)

  2. Create the plot objects that should be added to the graph (e.g. activity bars, milestones, icons, texts etc) and format them as wanted

  3. Add the object to the graph, with a call to GanttGraph::Add(), i.e. the activities, milestones etc.

  4. Send the graph back to the client or save it directly to a file, with a call to GanttGraph::Stroke()

Note

Even though there is no limit for the size of the Gantt chart (apart from available memory and execution time limit specified in "php.ini") the library defines two constants MAX_GANTTIMG_SIZE_W and MAX_GANTTIMG_SIZE_H that sets the maximum allowed image size for a Gantt chart. This is primarily meant to discover scripts gone wrong that tries to make very large images (perhaps by some non-properly terminating loops). If the overall image size becomes larger than these limit an error message will be shown.

Adjusting the scale headers

A gantt chart must always have at least one scale header and at most six scale headers (see Figure 16.54. Building block of a Gantt chart). Usually it is not advisable to use more than three scale headers at the same time. Having multiple scale headers allow the specification of the same date range but with different resolutions.

The library makes six different scale headers available which is identified by a symbolic constant that is logically combined to specify the wanted headers using the method

  • GanttGraph::ShowHeaders($aHeaderSelection)

The $aHeaderSelection argument is a binary combination of one or more of the following specifiers that indicates the interval used in the header

  1. GANTT_HMIN, Minute interval header (See Minute scale for label format options)

  2. GANTT_HHOUR, Hour interval header (See Hour scale for label format options)

  3. GANTT_HDAY, Day interval header (See Day scale for label format options)

  4. GANTT_HWEEK, Week interval header (See Week scale for label format options)

  5. GANTT_HMONTH, Month interval header (See Month scale for label format options)

  6. GANTT_HYEAR, Year interval header (See Year scale for label format options)

For example to show a year, month and week header the following line would be used

1
$graph->ShowHeaders( GANTT_HYEAR | GANTT_HMONTH | GANTT_HWEEK );

Any combination of the listed headers above can be used. The scale headers will always be drawn with the larger header rage on top ot a header with smaller range.

Scale headers week, day, hour , minute have a minimum span of 1 unit. This means that if, for example, the week header is displayed the minimum width of the overall scale is one week.

Caution

The overall minimum size of the scale regardless of what scale headers are displayed is one day. This means that it is not possible to just create a Gantt graph with , say 6 hour.

Specifying the wanted headers is the first step in controlling the header. The next step is to specify the format that should be used to print the date label in each of the selected headers. For example the week interval header will have a label at the start of every week. This could for example be indicated as week number, day of month, full date and so on. In order to adjust the headers the appropriate header instance variable must be access. The header instance variables are

  1. Graph::scale::minute

  2. Graph::scale::hour

  3. Graph::scale::day

  4. Graph::scale::week

  5. Graph::scale::month

  6. Graph::scale::year

The connection with the scale headers are shown in Figure 16.55. The Gantt scale properties which shows a cut out part of a larger gantt chart

Figure 16.55. The Gantt scale properties

The Gantt scale properties


All the headers are an instance of class HeaderProperty and supports the following formatting methods

  • HeaderProperty::SetFont($aFontFamily,$aFontStyle,$aFontSize)

    Specify the font to be used for the label

  • HeaderProperty::SetFontColor($aColor)

    Specify the font color to use

  • HeaderProperty::SetStyle($aStyle)

    The style depends on the actual header and all available styles for each header are shown below. The style specifies the format used for the scale header label

  • HeaderProperty::SetBackgroundColor($aColor)

    Set the header background color

  • HeaderProperty::SetFrameWeight($aWeight)

    Specify the weight of the frame around the scale header

  • HeaderProperty::SetTitleVertMargin($aMargin)

    Specifies the margin between this header and the next header (usually there is no need to adjust this)

  • HeaderProperty::SetInterval($aInterval)

    Specifies the interval between each scale label. For example specifying

    1
    
    $graph->scale->hour->SetInterval(6);

    Will step the hour label 6 hours for each label

So for example to set the font of the month header the following line would be used

1
$ganttgraph->scale->month->SetFont(FF_ARIAL,FS_NORMAL,10);

In addition to these methods each scale also has the property '$grid' which determines the appearance of grid lines for that specific scale. It is possible to adjust the appearance of the grid lines by the "normal" line methods, i.e.

  • SetColor($aColor), Set the grid color

  • SetWeight($aWeight), Set the grid line weight

  • SetStyle($aLineStyle), Set the grid line style, i.e. "solid", "dotted", "dashed", "long-dashed"

  • Show($aFlg=true), Enable the grid line

So for example to enable the week grid line and set it to red color the following lines would be needed

1
2
$graph->scale->week->grid->Show();
$graph->scale->week->grid->SetColor( 'red' );

The automatic grid lines have some "intelligence" so that higher resolution scales will not cut through part ways of scale headers with lower resolution (such as a year grid line cutting through the middle of a week).

Tip

It is possible to specify a zoom factor for the scale that adjusts how wide the automatic sized header should be. See Adjusting the scale zoom factor for more details.

Minute scale

Minute scale is enabled by adding the GANTT_HMIN in the GanttGraph::ShowHeaders() call, for example as the following line shows

1
$graph -> ShowHeaders ( GANTT_HDAY  |  GANTT_HHOUR  |  GANTT_HMIN );

The SetStyle($aStyle) method supports the following label styles

  • MINUTESTYLE_MM

    This will display minutes as a two digit number with a leading zero if necessary

  • MINUTESTYLE_CUSTOM

    This will let you specify you own custom minute style by making a call to HeaderProperty:: SetFormatString()

    The format string is specified as a format string for the date() function (See PHP Manual)

Hour scale

Minute scale is enabled by adding the GANTT_HHOUR in the GanttGraph::ShowHeaders() call, for example as the following line shows

1
$graph -> ShowHeaders ( GANTT_HDAY  |  GANTT_HHOUR  |  GANTT_HMIN );

The SetStyle($aStyle) method supports the following label styles

  • HOURSTYLE_HM24

    Will display the only the hour in military time 0-24 , for example 13:00

  • HOURSTYLE_H24

    Will display the hour with both hour and minute in military time 0-24, for example 13

  • HOURSTYLE_HMAMPM

    Will display the hour and minutes with a suitable am/pm postfix, for example 1:30pm

  • HOURSTYLE_HAMPM

    Will display only the hour with a suitable am/pm postfix, for example 1pm

  • HOURSTYLE_CUSTOM

    Custom defined format as specified with a call to HeaderProperty::SetFormatString()

    The format string is specified as a format string for the date() function (See PHP Manual)

For hours it is possible to specify the interval in either of two ways. With an integer, e.g. 6, or as time interval, e.g. "1:30" which makes the interval one and a half hour. The only restriction is that the interval must be a divisor of 24 since one day is the smallest possible interval to show. This means that it is allowed to use, for example 2,4,6,"1:30" or "0:45" as intervals but not 7, "2:45".

The code snippet below shows hot to set up a hour scale to with 45 minutes interval and custom colors

1
2
3
4
5
6
<?php
$graph->scale->hour->SetBackgroundColor( 'lightyellow:1.5' );
$graph->scale->hour->SetFont( FF_FONT1 );
$graph->scale->hour->SetStyle( HOURSTYLE_HMAMPM );
$graph->scale->hour->SetIntervall( '0:45' ); 
?>

The example in Figure 16.56. Gantt chart with day and hour scale enabled (gantthourex1.php) below shows a gantt chart with the day and hour scale enabled. In this example we have also added a gradient background to show some formatting options.

Figure 16.56. Gantt chart with day and hour scale enabled (gantthourex1.php)

Gantt chart with day and hour scale enabled (gantthourex1.php)


Day scale

The SetStyle($aStyle) method supports the following label styles

  • DAYSTYLE_ONELETTER,

    On letter week day. Example "M"

  • DAYSTYLE_LONG,

    Full week day. Example "Monday"

  • DAYSTYLE_LONGDAYDATE1,

    Day with date. Example "Monday 23 Jun"

  • DAYSTYLE_LONGDAYDATE2,

    Day with date+year. Example "Monday 23 Jun 2003"

  • DAYSTYLE_SHORT,

    Short date. Example "Mon"

  • DAYSTYLE_SHORTDAYDATE1,

    Short date+date. Example "Mon 23/6"

  • DAYSTYLE_SHORTDAYDATE2,

    Short date+date. Example "Mon 23 Jun"

  • DAYSTYLE_SHORTDAYDATE3,

    Short date+date. Example "Mon 23"

  • DAYSTYLE_SHORTDATE1,

    Short date. Example "23/6"

  • DAYSTYLE_SHORTDATE2,

    Short date. Example "23 Jun"

  • DAYSTYLE_SHORTDATE3,

    Short date. Example "Mon 23"

  • DAYSTYLE_SHORTDATE4,

    Short date. Example "23"

  • DAYSTYLE_CUSTOM,

    Custom specified formatting string. Example "%A"

    The format string is specified as a format string for the strftime() function (See PHP Manual)

    Caution

    Note that the day format string is a format string for strftime() while the format string for hour and minutes are given as a format string for the date() function. This inconsistency purely exists for historic reasons and is kept not to break existing scripts.

Example:

1
$graph->scale->day->SetStyle ( DAYSTYLE_LONG );

The graphical formatting possibilities for days allow the possibility to specify a different color for the weekend background and also for the Sunday.

  • HeaderProperty::SetWeekendColor($aColor)

    Set the background color for weekends. (Defaults to light gray)

  • HeaderProperty::SetSundayFontColor($aColor)

    The Sunday font color. (Defaults to red)

In addition to this there is also a possibility to choose whether or not the weekend background should be extended vertically down over the plot area which is the default. Since that is a property more of the whole plot this behavior is modified with a call to the method

  • GanttScale::UseWeekendBackground($aFlg=true)

    Example:

    1
    2
    
    // Don't use background for weekend in the plot area
    $graph->scale->UseWeekendBackground(false);

Note

The actual text displayed is dependent on the Locale used. See Localizing the Gantt chart scale

Week scale

Week scales, if enabled, by default shows the week number in range 1 to 53 (as defined by ISO-8601)

Note

It might be worth pointing out here that the week number calculation is carried out within the library and does not rely on the underlying OS date libraries. This makes the behavior consistent over several OS:s (at least MS Windows does not comply to ISO-8601 or supply any way of doing this through the normal libraries, e.g. strftime())

The SetStyle($aStyle) method supports the following label styles

  • WEEKSTYLE_WNBR

    Show week number. To further modify the formatting of the actual week number it is possible to optionally supply a format string with a call to

    • HeaderProperty::SetLabelFormatString($aFormat)

      The format for this string is the same format used for the sprintf() function and formats the week number given as an integer.

      Caution

      Note that the day format string is a format string for sprintf() while the format string for hour and minutes are given as a format string for the date() function. This inconsistency purely exists for historic reasons and is kept not to break existing scripts.

  • WEEKSTYLE_FIRSTDAY

    Show date of first day in week.

  • WEEKSTYLE_FIRSTDAY2

    Show date of first day in week and short month

  • WEEKSTYLE_FIRSTDAYWNBR

    Show week number of first day in week.

  • WEEKSTYLE_FIRSTDAY2WNBR

    Show week number of first day in week and month

Example:

1
$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY);

Note

The actual text displayed for month is dependent on the Locale used. See Localizing the Gantt chart scale

Month scale

The SetStyle($aStyle) method supports the following label styles

  • MONTHSTYLE_SHORTNAME

    Display the month name in its locale specific short form, i.e Jan, Feb etc

  • MONTHSTYLE_SHORTNAMEYEAR2

    Display the month name in its locale specific short form together with a 2 digit year , i.e Jan '01, Feb '01 etc

  • MONTHSTYLE_SHORTNAMEYEAR4

    Display the month name in its locale specific short form together with a 4 digit year , i.e Jan 2001, Feb 2001 etc

  • MONTHSTYLE_LONGNAME

    Display the month name in its locale specific long name, i.e. January, February

  • MONTHSTYLE_LONGNAMEYEAR2

    Display the month name in its locale specific long name together with a 2 digit year , i.e January '01, February '01 etc

  • MONTHSTYLE_LONGNAMEYEAR4

    Display the month name in its locale specific long name together with a 4 digit year , i.e January 2001, February 2001 etc

  • MONTHSTYLE_FIRSTLETTER

    The first letter of the month name

Example:

1
$graph->scale->month->SetStyle(MONTHSTYLE_LONGNAME);

Year scale

Year scale has no extra formatting possibilities it is always displayed as a four digit number , e.g. "2009"

Adding gantt objects to the chart

Gantt objects are primarily instances of one of two classes

  1. class GanttBar

    This is the main activity added to a Gantt chart to show the extension in time of one activity, a gantt bar

  2. class Milestone

    This activity is a special case of an activity with zero extension, usually indicating a milestone or a deadline

  3. class VLine

    This is similar so a millstone as it has no extension in time. Instead this object is visually represented as a vertical line that crosses the entire graph plot area. This is often used to mark, for example, phases in a project.

To add a Gantt objects there are two compulsory parameters that must be set. These parameters specify on what row and at what date the activity should start at.

Bars and Milestones need both a vertical position and a horizontal position. The horizontal start position is specified as a date, e.g. "2001-06-23", and the vertical positions are specified as a number [0,1,2,3,...]. This vertical number indicates the position from the top where the object should be placed. To understand this one could imagine a number of "invisible" horizontal bands with a certain height. If the vertical position is specifies as 0 the bar will be placed in the first band, specify 3 and the bar will be placed in the fourth band and so on.

All these "invisible bands" have the same height (equ-spaced). The height of each band is automatically determined and depends on both the method of layout ( as specified by (GanttChart::SetLayout()) and the individual heights of the individual bars and titles. The rules are quite simple:

  1. If layout=GANTT_FROMTOP (the default and most common) the height will equal the height (+ a margin) of the highest gantt bar. The height calculation of each bar takes into account both the actual bar, the title, and any left- right-marks (more about that later) that may be present.

    The name "fromtop" refers to that when the height is explicitly specified the bars will usually be added from band 0 and onwards and hence being added from the top. (This might leave empty space at the bottom of the plot area in the graph if the height of the graph has been explicitly specified).

  2. If layout=GANTT_EVEN the bars are evenly (hence the name) spread out over the available height in the gantt chart and no consideration is taken of the individual bars heights. Note that if you use automatic sizing even layout cannot be used. (It just doesn't make sense). Even layout is for those cases when a large area is specified and the bars should be evenly distributed using the full height.

So in summary each object must have two position parameters.

  1. Which row the gantt object should be drawn on.

    This should be a positive integer in the range (0, ...), It is perfectly legal to specify a large vertical position with no other object above as shown in Figure 16.59. Specifying a large vertical position (ganttex03.php)

  2. Which start and end date (or dates) the object should have.

    Start of bars are given as a date string. The format depends on the current locale. Examples of valid date strings are

    • "2001-10-22"

    • "2001-10-22"

    • "22 Oct 2001"

    Even if several format are supported it is recommended to use all numeric dates, i.e in the form "2001-10-22".

    Caution

    Watch our for the locale used since, for example, "2008-05-10" can have two meanings.

    Specifying the end position may be done in two different ways, either by the end date in the same way as for the start date. The other way is to specify the length of the activity in number of days (and fractions thereof). Examples of valid end dates are:

    • "2001-11-15"

    • "15 Nov 2001"

    • 22, (specifies duration of 22 days)

    • 22.7, (specifies duration of 22.7 days)

    Please note that duration must be specified as numerical values and not as a string.

Usually at least one or more of the following parameter is also specified

  1. The title of the gantt object

  2. The caption of the object. This is a text string that is drawn beside the object on the gantt chart

  3. Color and any optional patterns to separate different activities

  4. When applicable the state of a progress indicator (see Adding progress indicators)

Adding Gantt activity bars

Instances of class GanttBar is created with the constructor

  • GanttBar::__construct($aPos,$aLabel,$aStart,$aEnd,$aCaption="",$aHeightFactor=0.6)

    $aVPos The vertical position for the bar, [0..n]

    $aTitle Title for the activity

    $aStart Start date for the activity given as string, e.g "2001-09-22"

    $aEnd End date for activity given as either a date (a string) or as the duration (in days) of the activity, e.g both "2001-10-15" and 20.5 are valid inputs

    $aCaption Text string (caption) to appear at the end (right side) of the bar

    $aHeight Height of bar given as either a value in range [0,1] in which case this is interpretated as what fraction of the vertical position should the bar occupy. The height can also be given in absolute pixels [1..200]

In order to illustrate this we will create a the most basic (and simple ) Gantt chart possible. This will consist of just a chart with one activity bar.

Example 16.6. The simplest possible Gantt graph (ganttex00.php)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php // content="text/plain; charset=utf-8"
require_once ('jpgraph/jpgraph.php');
require_once ('jpgraph/jpgraph_gantt.php');
 
// A new graph with automatic size
$graph = new GanttGraph();
 
//  A new activity on row '0'
$activity = new GanttBar(0,"Activity 1","2001-12-21","2002-01-19");
$graph->Add($activity);
 
// Display the Gantt chart
$graph->Stroke();
?>


Figure 16.57. The simplest possible Gantt graph (ganttex00.php)

The simplest possible Gantt graph (ganttex00.php)


The example above will make use of just the default settings for all formatting parameters but still manage to create a perfectly readable Gantt chart with only 4 lines of real code. We can note a couple of things

  • By default two scale headers are used, week and day resolution

  • Weekends will have a gray background

  • Sunday scale header uses red for the "Sunday"

Lets now take the above simple graph and make a few small alterations.

  • We will add graph titles

  • We will change the pattern and color of the activity bar

  • We will adjust the scale headers so er have three headers and use the date of the start day for each week (in the week scale)

Figure 16.58. Making some minor alterations to the Gantt graph (ganttex01.php)

Making some minor alterations to the Gantt graph (ganttex01.php)


To show the effect of row positioning Figure 16.59. Specifying a large vertical position (ganttex03.php) shows the effect of adding a bar to row 7. This will as can be seen create graph that is mostly empty sine row 0-6 have no specified gantt objects.

Figure 16.59. Specifying a large vertical position (ganttex03.php)

Specifying a large vertical position (ganttex03.php)


The height of the bars can also be adjusted. The horizontal spacing between each bar is based on the highest single bar including the size of the title. By default the height of the bar is 60% of the overall vertical size allocated to each row (all the rows have the same height).

The height of the bar can be specified as either as an absolute number of pixels or as a fraction of the row height. Since by default the bar height is 60% this means that if any single line has, for example, a large title all the rows will be adjusted to the same size and hence the bars will also be adjusted to fill 60% of the new width.

Adding milestones

Instances of class Milestone is created with the constructor

  • MileStone::__construct($aVPos,$aLabel,$aDate,$aCaption='')

    $aVPos, The vertical position for the bar, [0..n]

    $aTitle, Title for the activity

    $aDate, Date for the milestone

    $aCaption, Text to the right of the milestone

Valid milestones are for example

1
2
$ms4 = new MileStone(3, 'Code complete', '2001-12-01'); 
$ms5 = new MileStone(3, 'Ready for test', '2002-01-06');

By default milestones are rendered as a filled "Diamond" shape. This may be optionally modified. The actual shape is specified by the 'mark' property of milestone which is an instance of class PlotMark. See Adding markers to the Gantt bars.

To change the shape of a milestone to, say a triangle, you use the SetType() method as in

1
$ms4->mark->SetType( MARK_DTRIANGLE );

An example of adding a milestone to a gantt graph is shown in Figure 16.60. Adding a milestone marker to a gantt graph (ganttex04.php)

Figure 16.60. Adding a milestone marker to a gantt graph (ganttex04.php)

Adding a milestone marker to a gantt graph (ganttex04.php)


We note that;

  • By default the title of a milestone is set in a red color. To change the title the "$title" property of the milestone must be accessed. For example

    1
    
    $milestone->title->SetColor('black');

  • A milestone has a caption in exactly the same way as an ordinary gantt bar

  • Milestones are added to the graph with the usual GanttGraph::Add()

Adding vertical lines (GanttVLine)

Instances of class GanttVLine is created with the constructor

  • GanttVLine::__construct($aDate,$aTitle='',$aColor='darkred',$aWeight=2,$aStyle='solid')

    $aDate Date for the milestone

    $aTitle Title for the line. The title is displayed at the bottom of the line

    $aColor Color of the line

    $aWeight Line width

    $aStyle Line style, specified as a string "dashed", "dotted" and so on

By default a GanttVLine will cover the entire Gantt area from the top to the bottom. It is also possible to restrict the area that the line is spanning by specifying the start and stop row for the line with a call to the method

  • GanttVLine::SetRowSpan($aStart, $aEnd)

If the end row is left out the line will go all the way to the bottom.

Note

Since there is a small margin from the top header row to the first Gantt row this means that specifying a start row of 0 (the very first gantt row) will leave a small margin between the line and the header row. If this is not desirable the start row can be specified as -1 in which case the line will go all the way up to the header row.

Valid creations of lines are for example

1
2
3
$vline1 = new GanttVLine('2001-12-24', 'Phase 1'); 
$vlin