| 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="973Milestones.html">
|
|
|
8 |
<LINK REL="Next" HREF="975Addingmarkerstoaganttbar.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="973Milestones.html">Previous</A>
|
|
|
26 |
<A HREF="975Addingmarkerstoaganttbar.html">Next</A>
|
|
|
27 |
<HR NOSHADE>
|
|
|
28 |
<H3><A NAME="9_7_4">9.7.4 Vertical line</A></H3>
|
|
|
29 |
<P> The final object you may add to a Gantt chart is simple, but quite
|
|
|
30 |
useful, a straight vertical line extending over the whole plot height.
|
|
|
31 |
This could for example be used to illustrate different phases in a
|
|
|
32 |
project. You create a line object by a call to GanttVLine()</P>
|
|
|
33 |
<P> The full signature for GanttVLine() is<DIV class="phpscript"><CODE><FONT
|
|
|
34 |
color="#000000"> <FONT color="#0000BB"> </FONT><FONT color="#007700">
|
|
|
35 |
function </FONT><FONT color="#0000BB">GanttVLine</FONT><FONT color="#007700">
|
|
|
36 |
(</FONT><FONT color="#0000BB">$aDate</FONT><FONT color="#007700">,</FONT><FONT
|
|
|
37 |
color="#0000BB">$aTitle</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">
|
|
|
38 |
$aColor</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">
|
|
|
39 |
$aWeight</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">
|
|
|
40 |
$aStyle</FONT><FONT color="#007700">)</FONT><FONT color="#0000BB"></FONT>
|
|
|
41 |
</FONT></CODE></DIV></P>
|
|
|
42 |
<P></P>
|
|
|
43 |
<P></P>
|
|
|
44 |
<TABLE border="0">
|
|
|
45 |
<TR><TD valign="top">
|
|
|
46 |
<!--span style="font-family:times;font-size:85%;font-weight:bold;"-->
|
|
|
47 |
<CODE><FONT color="#000000"> <FONT color="#0000BB"> $aDate </FONT></FONT>
|
|
|
48 |
</CODE></TD><TD valign="top"> </TD><TD>Date for the milestone</TD></TR>
|
|
|
49 |
<TR><TD valign="top">
|
|
|
50 |
<!--span style="font-family:times;font-size:85%;font-weight:bold;"-->
|
|
|
51 |
<CODE><FONT color="#000000"> <FONT color="#0000BB"> $aTitle </FONT></FONT>
|
|
|
52 |
</CODE></TD><TD valign="top"> </TD><TD>Title for the line. The title is
|
|
|
53 |
displayed at the bottom of the line</TD></TR>
|
|
|
54 |
<TR><TD valign="top">
|
|
|
55 |
<!--span style="font-family:times;font-size:85%;font-weight:bold;"-->
|
|
|
56 |
<CODE><FONT color="#000000"> <FONT color="#0000BB"> $aColor </FONT></FONT>
|
|
|
57 |
</CODE></TD><TD valign="top"> </TD><TD>Color for the line</TD></TR>
|
|
|
58 |
<TR><TD valign="top">
|
|
|
59 |
<!--span style="font-family:times;font-size:85%;font-weight:bold;"-->
|
|
|
60 |
<CODE><FONT color="#000000"> <FONT color="#0000BB"> $aWeight </FONT></FONT>
|
|
|
61 |
</CODE></TD><TD valign="top"> </TD><TD>Line width</TD></TR>
|
|
|
62 |
<TR><TD valign="top">
|
|
|
63 |
<!--span style="font-family:times;font-size:85%;font-weight:bold;"-->
|
|
|
64 |
<CODE><FONT color="#000000"> <FONT color="#0000BB"> $aStyle </FONT></FONT>
|
|
|
65 |
</CODE></TD><TD valign="top"> </TD><TD>Line style,"dashed", "dotted" and
|
|
|
66 |
so on</TD></TR>
|
|
|
67 |
</TABLE>
|
|
|
68 |
<P> Valid creations of lines are for example</P>
|
|
|
69 |
<UL>
|
|
|
70 |
<LI><DIV class="phpscript"><CODE><FONT color="#000000"> <FONT color="#0000BB">
|
|
|
71 |
$vline </FONT><FONT color="#007700">= new </FONT><FONT color="#0000BB">
|
|
|
72 |
GanttVLine</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">
|
|
|
73 |
"2001-12-24"</FONT><FONT color="#007700">);</FONT><FONT color="#0000BB"></FONT>
|
|
|
74 |
</FONT></CODE></DIV>
|
|
|
75 |
<P></P>
|
|
|
76 |
</LI>
|
|
|
77 |
<LI><DIV class="phpscript"><CODE><FONT color="#000000"> <FONT color="#0000BB">
|
|
|
78 |
$vline </FONT><FONT color="#007700">= new </FONT><FONT color="#0000BB">
|
|
|
79 |
GanttVLine</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">
|
|
|
80 |
"2001-12-24"</FONT><FONT color="#007700">,</FONT><FONT color="#DD0000">
|
|
|
81 |
"Phase 1"</FONT><FONT color="#007700">);</FONT><FONT color="#0000BB"></FONT>
|
|
|
82 |
</FONT></CODE></DIV>
|
|
|
83 |
<P></P>
|
|
|
84 |
</LI>
|
|
|
85 |
<LI><DIV class="phpscript"><CODE><FONT color="#000000"> <FONT color="#0000BB">
|
|
|
86 |
$vline </FONT><FONT color="#007700">= new </FONT><FONT color="#0000BB">
|
|
|
87 |
GanttVLine</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">
|
|
|
88 |
"2001-12-24"</FONT><FONT color="#007700">,</FONT><FONT color="#DD0000">
|
|
|
89 |
"Phase 1"</FONT><FONT color="#007700">,</FONT><FONT color="#DD0000">
|
|
|
90 |
"darkred"</FONT><FONT color="#007700">);</FONT><FONT color="#0000BB"></FONT>
|
|
|
91 |
</FONT></CODE></DIV>
|
|
|
92 |
<P></P>
|
|
|
93 |
</LI>
|
|
|
94 |
<LI><DIV class="phpscript"><CODE><FONT color="#000000"> <FONT color="#0000BB">
|
|
|
95 |
$vline </FONT><FONT color="#007700">= new </FONT><FONT color="#0000BB">
|
|
|
96 |
GanttVLine</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">
|
|
|
97 |
"2001-12-24"</FONT><FONT color="#007700">,</FONT><FONT color="#DD0000">
|
|
|
98 |
"Phase 1"</FONT><FONT color="#007700">,</FONT><FONT color="#DD0000">
|
|
|
99 |
"darkred"</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">5</FONT><FONT
|
|
|
100 |
color="#007700">);</FONT><FONT color="#0000BB"></FONT></FONT></CODE></DIV>
|
|
|
101 |
<P></P>
|
|
|
102 |
</LI>
|
|
|
103 |
<LI><DIV class="phpscript"><CODE><FONT color="#000000"> <FONT color="#0000BB">
|
|
|
104 |
$vline </FONT><FONT color="#007700">= new </FONT><FONT color="#0000BB">
|
|
|
105 |
GanttVLine</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">
|
|
|
106 |
"2001-12-24"</FONT><FONT color="#007700">,</FONT><FONT color="#DD0000">
|
|
|
107 |
"Phase 1"</FONT><FONT color="#007700">,</FONT><FONT color="#DD0000">
|
|
|
108 |
"darkred"</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">5</FONT><FONT
|
|
|
109 |
color="#007700">,</FONT><FONT color="#DD0000">"dotted"</FONT><FONT color="#007700">
|
|
|
110 |
);</FONT><FONT color="#0000BB"></FONT></FONT></CODE></DIV>
|
|
|
111 |
<P></P>
|
|
|
112 |
</LI>
|
|
|
113 |
</UL>
|
|
|
114 |
<P> To add the line to the graph you just have to call GanttGraph::Add()
|
|
|
115 |
as with milestones and bars. Let's illustrate the use of vertical lines
|
|
|
116 |
by adding a line to the previous example.<DIV class="phpscript"><CODE><FONT
|
|
|
117 |
color="#000000"> <FONT color="#0000BB"> $vline </FONT><FONT color="#007700">
|
|
|
118 |
= new </FONT><FONT color="#0000BB">GanttVLine</FONT><FONT color="#007700">
|
|
|
119 |
(</FONT><FONT color="#DD0000">"2001-12-24"</FONT><FONT color="#007700">,</FONT><FONT
|
|
|
120 |
color="#DD0000">"Phase 1"</FONT><FONT color="#007700">);
|
|
|
121 |
<BR></FONT><FONT color="#0000BB">$graph</FONT><FONT color="#007700">-></FONT><FONT
|
|
|
122 |
color="#0000BB">Add</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">
|
|
|
123 |
$vline</FONT><FONT color="#007700">);
|
|
|
124 |
<BR></FONT><FONT color="#0000BB"></FONT></FONT></CODE></DIV></P>
|
|
|
125 |
<P> and the example (See 153) now becomes<DIV class="example">
|
|
|
126 |
<BR> <A href="exframes/frame_ganttex06.html" target="blank"><IMG border="0"
|
|
|
127 |
HEIGHT="189" src="img/img/img/img/img/img/ganttex06.png" WIDTH="502"></A>
|
|
|
128 |
<BR><B>Figure 153:</B> Adding a vertical line with a title to the Gantt
|
|
|
129 |
chart <A href="exframes/frame_ganttex06.html" target="blank">[src]</A>
|
|
|
130 |
<P></P>
|
|
|
131 |
</DIV></P>
|
|
|
132 |
<P> From the above figure you can see that by default the line is drawn
|
|
|
133 |
at the beginning of the day of the specified date and in a 'dashed'
|
|
|
134 |
style. This can (of course!) be modified so that the line is
|
|
|
135 |
drawn/aligned anywhere in the specified day. You modify this by
|
|
|
136 |
invoking the method SetDayOffset() with an argument specifying the
|
|
|
137 |
fraction of the day where you want the line positioned.</P>
|
|
|
138 |
<P> If you, for example, want to display the line in the middle of the
|
|
|
139 |
day just add the line<DIV class="phpscript"><CODE><FONT color="#000000">
|
|
|
140 |
<FONT color="#0000BB"> $vline</FONT><FONT color="#007700">-></FONT><FONT
|
|
|
141 |
color="#0000BB">SetDayOffset</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">
|
|
|
142 |
0.5</FONT><FONT color="#007700">);</FONT><FONT color="#0000BB"></FONT></FONT>
|
|
|
143 |
</CODE></DIV></P>
|
|
|
144 |
<P> to the previous code and the result will be<DIV class="example">
|
|
|
145 |
<BR> <A href="exframes/frame_ganttex07.html" target="blank"><IMG border="0"
|
|
|
146 |
HEIGHT="189" src="img/img/img/img/img/img/ganttex07.png" WIDTH="502"></A>
|
|
|
147 |
<BR><B>Figure 154:</B> Modifying the position of the line within the day
|
|
|
148 |
<A href="exframes/frame_ganttex07.html" target="blank">[src]</A>
|
|
|
149 |
<P></P>
|
|
|
150 |
</DIV></P>
|
|
|
151 |
<P></P>
|
|
|
152 |
<P> As usual you may modify the font, size and color by invoking the
|
|
|
153 |
appropriate method (SetFont(), SetColor()) on the 'title' property of
|
|
|
154 |
lines.</P>
|
|
|
155 |
<HR NOSHADE>
|
|
|
156 |
<A HREF="toc.html">Contents</A>
|
|
|
157 |
<A HREF="973Milestones.html">Previous</A>
|
|
|
158 |
<A HREF="975Addingmarkerstoaganttbar.html">Next</A>
|
|
|
159 |
</BODY>
|
|
|
160 |
</HTML>
|