Blame | Letzte Änderung | Log anzeigen | RSS feed
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"><HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-iso-8859-1"><LINK REL="Start" HREF="index.html"><LINK REL="Contents" HREF="toc.html"><LINK REL="Prev" HREF="1072Specifyingstartandendpositionforabar.html"><LINK REL="Next" HREF="1074Verticalline.html"><STYLE TYPE="text/css"><!--BODY { font-family: serif }H1 { font-family: sans-serif }H2 { font-family: sans-serif }H3 { font-family: sans-serif }H4 { font-family: sans-serif }H5 { font-family: sans-serif }H6 { font-family: sans-serif }SUB { font-size: smaller }SUP { font-size: smaller }PRE { font-family: monospace }A { text-decoration: none }--></STYLE></HEAD><BODY><A HREF="toc.html">Contents</A><A HREF="1072Specifyingstartandendpositionforabar.html">Previous</A><A HREF="1074Verticalline.html">Next</A><HR NOSHADE><H3><A NAME="10_7_3">10.7.3 Milestones</A></H3><P> Milestones are similar to bars but have no end date since milestonesjust apply to one single date. Milestones are created much the same wayas activities but using method MileStone() instead.</P><P> The full signature for milestones are<DIV class="phpscript"><CODE><FONTcolor="#000000"> <FONT color="#0000BB"> </FONT><FONT color="#007700">function </FONT><FONT color="#0000BB">MileStone</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">$aVPos</FONT><FONT color="#007700">,</FONT><FONTcolor="#0000BB">$aTitle</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">$aDate</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">$aCaption</FONT><FONT color="#007700">)</FONT><FONT color="#0000BB"></FONT></FONT></CODE></DIV></P><P></P><P></P><TABLE border="0"><TR><TD valign="top"><!--span style="font-family:times;font-size:85%;font-weight:bold;"--><CODE><FONT color="#000000"> <FONT color="#0000BB"> $aVPos </FONT></FONT></CODE></TD><TD valign="top"> </TD><TD>The vertical position for thebar, [0..n]</TD></TR><TR><TD valign="top"><!--span style="font-family:times;font-size:85%;font-weight:bold;"--><CODE><FONT color="#000000"> <FONT color="#0000BB"> $aTitle </FONT></FONT></CODE></TD><TD valign="top"> </TD><TD>Title for the activity</TD></TR><TR><TD valign="top"><!--span style="font-family:times;font-size:85%;font-weight:bold;"--><CODE><FONT color="#000000"> <FONT color="#0000BB"> $aDate </FONT></FONT></CODE></TD><TD valign="top"> </TD><TD>Date for the milestone</TD></TR><TR><TD valign="top"><!--span style="font-family:times;font-size:85%;font-weight:bold;"--><CODE><FONT color="#000000"> <FONT color="#0000BB"> $aCaption </FONT></FONT></CODE></TD><TD valign="top"> </TD><TD>Text to the right of themilestone</TD></TR></TABLE><P> Valid milestones are for example</P><UL><LI><DIV class="phpscript"><CODE><FONT color="#000000"> <FONT color="#0000BB"> $milestone </FONT><FONT color="#007700">= new </FONT><FONT color="#0000BB">MileStone</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">3</FONT><FONTcolor="#007700">,</FONT><FONT color="#DD0000">"Code complete"</FONT><FONTcolor="#007700">,</FONT><FONT color="#DD0000">"2001-12-01"</FONT><FONT color="#007700">);</FONT><FONT color="#0000BB"></FONT></FONT></CODE></DIV><P></P></LI><LI><DIV class="phpscript"><CODE><FONT color="#000000"> <FONT color="#0000BB"> $milestone </FONT><FONT color="#007700">= new </FONT><FONT color="#0000BB">MileStone</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">3</FONT><FONTcolor="#007700">,</FONT><FONT color="#DD0000">"Code complete"</FONT><FONTcolor="#007700">,</FONT><FONT color="#DD0000">"2001-12-01"</FONT><FONT color="#007700">,</FONT><FONT color="#DD0000">"(2001-12-01)"</FONT><FONT color="#007700">);</FONT><FONT color="#0000BB"></FONT></FONT></CODE></DIV><P></P></LI></UL><P> By default milestones are rendered as a filled "Diamond" shape. Thismay 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).</P><P> To change the shape of a milestone to, say a triangle, you use theSetType() method as in<DIV class="phpscript"><CODE><FONT color="#000000"><FONT color="#0000BB"> $milestone</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">mark</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">SetType</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">MARK_DTRIANGLE</FONT><FONT color="#007700">)</FONT><FONT color="#0000BB"></FONT></FONT></CODE></DIV></P><P> Let's put this into practice and add a milestone to our previousexample by adding the following two lines of code which result inFigure 147 shown below.<DIV class="example"><BR> <A href="exframes/frame_ganttex04.html" target="blank"><IMG border="0"HEIGHT="189" src="img/ganttex04.png" WIDTH="493"></A><BR><B>Figure 147:</B> Illustration of how to add a milestone to a ganttchart <A href="exframes/frame_ganttex04.html" target="blank">[src]</A> <P></P></DIV></P><P></P><P> 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 wouldinvoke the SetColor() and SetFont() methods on the title property ofmilestones as in<DIV class="phpscript"><CODE><FONT color="#000000"> <FONTcolor="#0000BB"> $milestone</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">title</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">SetFont</FONT><FONTcolor="#007700">(</FONT><FONT color="#0000BB">FF_FONT1</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">FF_BOLD</FONT><FONT color="#007700">);<BR></FONT><FONT color="#0000BB">$milestone</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">title</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">SetColor</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">"black"</FONT><FONT color="#007700">);</FONT><FONT color="#0000BB"></FONT></FONT></CODE></DIV></P><P> and thew result would now (not surprisingly be)<DIV class="example"><BR> <A href="exframes/frame_ganttex05.html" target="blank"><IMG border="0"HEIGHT="189" src="img/ganttex05.png" WIDTH="502"></A><BR><B>Figure 148:</B> Modifying the milestone title color and font <A href="exframes/frame_ganttex05.html"target="blank">[src]</A> <P></P></DIV></P><P> To modify the caption you do exactly the same but act on property'caption' instead of 'title', i.e.<DIV class="phpscript"><CODE><FONT color="#000000"><FONT color="#0000BB"> $milestone</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">caption</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">SetFont</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">FF_FONT1</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">FF_BOLD</FONT><FONT color="#007700">);<BR></FONT><FONT color="#0000BB">$milestone</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">caption</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">SetColor</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">"black"</FONT><FONT color="#007700">);</FONT><FONT color="#0000BB"></FONT></FONT></CODE></DIV></P><P></P><P> It is worth noting that you modify the bar title and caption theexact same way by acting on the 'title' and 'caption' property for thebars.</P><HR NOSHADE><A HREF="toc.html">Contents</A><A HREF="1072Specifyingstartandendpositionforabar.html">Previous</A><A HREF="1074Verticalline.html">Next</A></BODY></HTML>