Milestones are similar to bars but have no end date since milestones just apply to one single date. Milestones are created much the same way as activities but using method MileStone() instead.
The full signature for milestones are
function MileStone ($aVPos,$aTitle, $aDate, $aCaption)
||The vertical position for the bar, [0..n]|
||Title for the activity|
||Date for the milestone|
||Text to the right of the milestone|
Valid milestones are for example
$milestone = new MileStone(3,"Code complete","2001-12-01" );
$milestone = new MileStone(3,"Code complete","2001-12-01" ,"(2001-12-01)" );
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 the PlotMark() class (same class responsible for the marks in line graphs).
To change the shape of a milestone to, say a triangle, you use the SetType() method as in
$milestone->mark-> SetType( MARK_DTRIANGLE)
Let's put this into practice and add a milestone to our previous example by adding the following two lines of code which result in Figure 147 shown below.
You may note that by default the title color is red for milestones. If you like to change this to be instead, say bold black, you would invoke the SetColor() and SetFont() methods on the title property of milestones as in
$milestone-> title->SetFont(FF_FONT1 ,FF_BOLD);
$milestone ->title->SetColor( "black");
and thew result would now (not surprisingly be)
To modify the caption you do exactly the same but act on property 'caption' instead of 'title', i.e.
$milestone->caption-> SetFont( FF_FONT1, FF_BOLD);
$milestone ->caption->SetColor( "black");
It is worth noting that you modify the bar title and caption the exact same way by acting on the 'title' and 'caption' property for the bars.