| 1 |
lars |
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
|
|
|
2 |
<HTML>
|
|
|
3 |
<HEAD>
|
|
|
4 |
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-iso-8859-1">
|
|
|
5 |
<LINK REL="Start" HREF="index.html">
|
|
|
6 |
<LINK REL="Contents" HREF="toc.html">
|
|
|
7 |
<LINK REL="Prev" HREF="1072Specifyingstartandendpositionforabar.html">
|
|
|
8 |
<LINK REL="Next" HREF="1074Verticalline.html">
|
|
|
9 |
<STYLE TYPE="text/css"><!--
|
|
|
10 |
BODY { font-family: serif }
|
|
|
11 |
H1 { font-family: sans-serif }
|
|
|
12 |
H2 { font-family: sans-serif }
|
|
|
13 |
H3 { font-family: sans-serif }
|
|
|
14 |
H4 { font-family: sans-serif }
|
|
|
15 |
H5 { font-family: sans-serif }
|
|
|
16 |
H6 { font-family: sans-serif }
|
|
|
17 |
SUB { font-size: smaller }
|
|
|
18 |
SUP { font-size: smaller }
|
|
|
19 |
PRE { font-family: monospace }
|
|
|
20 |
A { text-decoration: none }
|
|
|
21 |
--></STYLE>
|
|
|
22 |
</HEAD>
|
|
|
23 |
<BODY>
|
|
|
24 |
<A HREF="toc.html">Contents</A>
|
|
|
25 |
<A HREF="1072Specifyingstartandendpositionforabar.html">Previous</A>
|
|
|
26 |
<A HREF="1074Verticalline.html">Next</A>
|
|
|
27 |
<HR NOSHADE>
|
|
|
28 |
<H3><A NAME="10_7_3">10.7.3 Milestones</A></H3>
|
|
|
29 |
<P> Milestones are similar to bars but have no end date since milestones
|
|
|
30 |
just apply to one single date. Milestones are created much the same way
|
|
|
31 |
as activities but using method MileStone() instead.</P>
|
|
|
32 |
<P> The full signature for milestones are<DIV class="phpscript"><CODE><FONT
|
|
|
33 |
color="#000000"> <FONT color="#0000BB"> </FONT><FONT color="#007700">
|
|
|
34 |
function </FONT><FONT color="#0000BB">MileStone</FONT><FONT color="#007700">
|
|
|
35 |
(</FONT><FONT color="#0000BB">$aVPos</FONT><FONT color="#007700">,</FONT><FONT
|
|
|
36 |
color="#0000BB">$aTitle</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">
|
|
|
37 |
$aDate</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">
|
|
|
38 |
$aCaption</FONT><FONT color="#007700">)</FONT><FONT color="#0000BB"></FONT>
|
|
|
39 |
</FONT></CODE></DIV></P>
|
|
|
40 |
<P></P>
|
|
|
41 |
<P></P>
|
|
|
42 |
<TABLE border="0">
|
|
|
43 |
<TR><TD valign="top">
|
|
|
44 |
<!--span style="font-family:times;font-size:85%;font-weight:bold;"-->
|
|
|
45 |
<CODE><FONT color="#000000"> <FONT color="#0000BB"> $aVPos </FONT></FONT>
|
|
|
46 |
</CODE></TD><TD valign="top"> </TD><TD>The vertical position for the
|
|
|
47 |
bar, [0..n]</TD></TR>
|
|
|
48 |
<TR><TD valign="top">
|
|
|
49 |
<!--span style="font-family:times;font-size:85%;font-weight:bold;"-->
|
|
|
50 |
<CODE><FONT color="#000000"> <FONT color="#0000BB"> $aTitle </FONT></FONT>
|
|
|
51 |
</CODE></TD><TD valign="top"> </TD><TD>Title for the activity</TD></TR>
|
|
|
52 |
<TR><TD valign="top">
|
|
|
53 |
<!--span style="font-family:times;font-size:85%;font-weight:bold;"-->
|
|
|
54 |
<CODE><FONT color="#000000"> <FONT color="#0000BB"> $aDate </FONT></FONT>
|
|
|
55 |
</CODE></TD><TD valign="top"> </TD><TD>Date for the milestone</TD></TR>
|
|
|
56 |
<TR><TD valign="top">
|
|
|
57 |
<!--span style="font-family:times;font-size:85%;font-weight:bold;"-->
|
|
|
58 |
<CODE><FONT color="#000000"> <FONT color="#0000BB"> $aCaption </FONT></FONT>
|
|
|
59 |
</CODE></TD><TD valign="top"> </TD><TD>Text to the right of the
|
|
|
60 |
milestone</TD></TR>
|
|
|
61 |
</TABLE>
|
|
|
62 |
<P> Valid milestones are for example</P>
|
|
|
63 |
<UL>
|
|
|
64 |
<LI><DIV class="phpscript"><CODE><FONT color="#000000"> <FONT color="#0000BB">
|
|
|
65 |
$milestone </FONT><FONT color="#007700">= new </FONT><FONT color="#0000BB">
|
|
|
66 |
MileStone</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">3</FONT><FONT
|
|
|
67 |
color="#007700">,</FONT><FONT color="#DD0000">"Code complete"</FONT><FONT
|
|
|
68 |
color="#007700">,</FONT><FONT color="#DD0000">"2001-12-01"</FONT><FONT color="#007700">
|
|
|
69 |
);</FONT><FONT color="#0000BB"></FONT></FONT></CODE></DIV>
|
|
|
70 |
<P></P>
|
|
|
71 |
</LI>
|
|
|
72 |
<LI><DIV class="phpscript"><CODE><FONT color="#000000"> <FONT color="#0000BB">
|
|
|
73 |
$milestone </FONT><FONT color="#007700">= new </FONT><FONT color="#0000BB">
|
|
|
74 |
MileStone</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">3</FONT><FONT
|
|
|
75 |
color="#007700">,</FONT><FONT color="#DD0000">"Code complete"</FONT><FONT
|
|
|
76 |
color="#007700">,</FONT><FONT color="#DD0000">"2001-12-01"</FONT><FONT color="#007700">
|
|
|
77 |
,</FONT><FONT color="#DD0000">"(2001-12-01)"</FONT><FONT color="#007700">
|
|
|
78 |
);</FONT><FONT color="#0000BB"></FONT></FONT></CODE></DIV>
|
|
|
79 |
<P></P>
|
|
|
80 |
</LI>
|
|
|
81 |
</UL>
|
|
|
82 |
<P> By default milestones are rendered as a filled "Diamond" shape. This
|
|
|
83 |
may be optionally modified. The actual shape is specified by the 'mark'
|
|
|
84 |
property of milestone which is an instance of the PlotMark() class
|
|
|
85 |
(same class responsible for the marks in line graphs).</P>
|
|
|
86 |
<P> To change the shape of a milestone to, say a triangle, you use the
|
|
|
87 |
SetType() method as in<DIV class="phpscript"><CODE><FONT color="#000000">
|
|
|
88 |
<FONT color="#0000BB"> $milestone</FONT><FONT color="#007700">-></FONT><FONT
|
|
|
89 |
color="#0000BB">mark</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">
|
|
|
90 |
SetType</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">
|
|
|
91 |
MARK_DTRIANGLE</FONT><FONT color="#007700">)</FONT><FONT color="#0000BB">
|
|
|
92 |
</FONT></FONT></CODE></DIV></P>
|
|
|
93 |
<P> Let's put this into practice and add a milestone to our previous
|
|
|
94 |
example by adding the following two lines of code which result in
|
|
|
95 |
Figure 147 shown below.<DIV class="example">
|
|
|
96 |
<BR> <A href="exframes/frame_ganttex04.html" target="blank"><IMG border="0"
|
|
|
97 |
HEIGHT="189" src="img/ganttex04.png" WIDTH="493"></A>
|
|
|
98 |
<BR><B>Figure 147:</B> Illustration of how to add a milestone to a gantt
|
|
|
99 |
chart <A href="exframes/frame_ganttex04.html" target="blank">[src]</A>
|
|
|
100 |
<P></P>
|
|
|
101 |
</DIV></P>
|
|
|
102 |
<P></P>
|
|
|
103 |
<P> You may note that by default the title color is red for milestones.
|
|
|
104 |
If you like to change this to be instead, say bold black, you would
|
|
|
105 |
invoke the SetColor() and SetFont() methods on the title property of
|
|
|
106 |
milestones as in<DIV class="phpscript"><CODE><FONT color="#000000"> <FONT
|
|
|
107 |
color="#0000BB"> $milestone</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">
|
|
|
108 |
title</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">SetFont</FONT><FONT
|
|
|
109 |
color="#007700">(</FONT><FONT color="#0000BB">FF_FONT1</FONT><FONT color="#007700">
|
|
|
110 |
,</FONT><FONT color="#0000BB">FF_BOLD</FONT><FONT color="#007700">);
|
|
|
111 |
<BR></FONT><FONT color="#0000BB">$milestone</FONT><FONT color="#007700">
|
|
|
112 |
-></FONT><FONT color="#0000BB">title</FONT><FONT color="#007700">-></FONT><FONT
|
|
|
113 |
color="#0000BB">SetColor</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">
|
|
|
114 |
"black"</FONT><FONT color="#007700">);</FONT><FONT color="#0000BB"></FONT>
|
|
|
115 |
</FONT></CODE></DIV></P>
|
|
|
116 |
<P> and thew result would now (not surprisingly be)<DIV class="example">
|
|
|
117 |
<BR> <A href="exframes/frame_ganttex05.html" target="blank"><IMG border="0"
|
|
|
118 |
HEIGHT="189" src="img/ganttex05.png" WIDTH="502"></A>
|
|
|
119 |
<BR><B>Figure 148:</B> Modifying the milestone title color and font <A href="exframes/frame_ganttex05.html"
|
|
|
120 |
target="blank">[src]</A>
|
|
|
121 |
<P></P>
|
|
|
122 |
</DIV></P>
|
|
|
123 |
<P> To modify the caption you do exactly the same but act on property
|
|
|
124 |
'caption' instead of 'title', i.e.<DIV class="phpscript"><CODE><FONT color="#000000">
|
|
|
125 |
<FONT color="#0000BB"> $milestone</FONT><FONT color="#007700">-></FONT><FONT
|
|
|
126 |
color="#0000BB">caption</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">
|
|
|
127 |
SetFont</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">
|
|
|
128 |
FF_FONT1</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">
|
|
|
129 |
FF_BOLD</FONT><FONT color="#007700">);
|
|
|
130 |
<BR></FONT><FONT color="#0000BB">$milestone</FONT><FONT color="#007700">
|
|
|
131 |
-></FONT><FONT color="#0000BB">caption</FONT><FONT color="#007700">-></FONT><FONT
|
|
|
132 |
color="#0000BB">SetColor</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">
|
|
|
133 |
"black"</FONT><FONT color="#007700">);</FONT><FONT color="#0000BB"></FONT>
|
|
|
134 |
</FONT></CODE></DIV></P>
|
|
|
135 |
<P></P>
|
|
|
136 |
<P> It is worth noting that you modify the bar title and caption the
|
|
|
137 |
exact same way by acting on the 'title' and 'caption' property for the
|
|
|
138 |
bars.</P>
|
|
|
139 |
<HR NOSHADE>
|
|
|
140 |
<A HREF="toc.html">Contents</A>
|
|
|
141 |
<A HREF="1072Specifyingstartandendpositionforabar.html">Previous</A>
|
|
|
142 |
<A HREF="1074Verticalline.html">Next</A>
|
|
|
143 |
</BODY>
|
|
|
144 |
</HTML>
|