| 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="974Verticalline.html">
|
|
|
8 |
<LINK REL="Next" HREF="976Adjustingtheminimumdistancebetweenbars.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="974Verticalline.html">Previous</A>
|
|
|
26 |
<A HREF="976Adjustingtheminimumdistancebetweenbars.html">Next</A>
|
|
|
27 |
<HR NOSHADE>
|
|
|
28 |
<H3><A NAME="9_7_5">9.7.5 Adding markers to a gantt bar</A></H3>
|
|
|
29 |
<P> You can easily add a variety of markers both to the start and end of
|
|
|
30 |
the gantt bar. They could for example be used as an alternate way to
|
|
|
31 |
illustrate important milestones or anticipated deliveries.</P>
|
|
|
32 |
<P> The left and right markers are accessed through the two properties
|
|
|
33 |
'leftMark' and 'rightMark'. They are both instances of the general
|
|
|
34 |
'PlotMark' class which is also used for the milestones (and in line
|
|
|
35 |
graphs). The 'PlotMark' class supports several different styles, for
|
|
|
36 |
example, diamond (the default for milestones), filled and unfilled
|
|
|
37 |
circles, squares, stares, and so on. Please refer to the reference
|
|
|
38 |
section for a complete listing.</P>
|
|
|
39 |
<P> Let's illustrate this by adding a right marker to the previous
|
|
|
40 |
example. We will use a style of a filled (red) circle with a white
|
|
|
41 |
title, say, "M5". In order to accomplish this we must augment the
|
|
|
42 |
previous example with the following lines:<DIV class="phpscript"><CODE><FONT
|
|
|
43 |
color="#000000"> <FONT color="#0000BB"> $activity</FONT><FONT color="#007700">
|
|
|
44 |
-></FONT><FONT color="#0000BB">rightMark</FONT><FONT color="#007700">-></FONT><FONT
|
|
|
45 |
color="#0000BB">Show</FONT><FONT color="#007700">();
|
|
|
46 |
<BR></FONT><FONT color="#0000BB">$activity</FONT><FONT color="#007700">
|
|
|
47 |
-></FONT><FONT color="#0000BB">rightMark</FONT><FONT color="#007700">-></FONT><FONT
|
|
|
48 |
color="#0000BB">title</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">
|
|
|
49 |
Set</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">"M5"</FONT><FONT
|
|
|
50 |
color="#007700">);
|
|
|
51 |
<BR></FONT><FONT color="#0000BB">$activity</FONT><FONT color="#007700">
|
|
|
52 |
-></FONT><FONT color="#0000BB">rightMark</FONT><FONT color="#007700">-></FONT><FONT
|
|
|
53 |
color="#0000BB">SetType</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">
|
|
|
54 |
MARK_FILLEDCIRCLE</FONT><FONT color="#007700">);
|
|
|
55 |
<BR></FONT><FONT color="#0000BB">$activity</FONT><FONT color="#007700">
|
|
|
56 |
-></FONT><FONT color="#0000BB">rightMark</FONT><FONT color="#007700">-></FONT><FONT
|
|
|
57 |
color="#0000BB">SetWidth</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">
|
|
|
58 |
10</FONT><FONT color="#007700">);
|
|
|
59 |
<BR></FONT><FONT color="#0000BB">$activity</FONT><FONT color="#007700">
|
|
|
60 |
-></FONT><FONT color="#0000BB">rightMark</FONT><FONT color="#007700">-></FONT><FONT
|
|
|
61 |
color="#0000BB">SetColor</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">
|
|
|
62 |
"red"</FONT><FONT color="#007700">);
|
|
|
63 |
<BR></FONT><FONT color="#0000BB">$activity</FONT><FONT color="#007700">
|
|
|
64 |
-></FONT><FONT color="#0000BB">rightMark</FONT><FONT color="#007700">-></FONT><FONT
|
|
|
65 |
color="#0000BB">SetFillColor</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">
|
|
|
66 |
"red"</FONT><FONT color="#007700">);
|
|
|
67 |
<BR></FONT><FONT color="#0000BB">$activity</FONT><FONT color="#007700">
|
|
|
68 |
-></FONT><FONT color="#0000BB">rightMark</FONT><FONT color="#007700">-></FONT><FONT
|
|
|
69 |
color="#0000BB">title</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">
|
|
|
70 |
SetFont</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">
|
|
|
71 |
FF_ARIAL</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">
|
|
|
72 |
FS_BOLD</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">12</FONT><FONT
|
|
|
73 |
color="#007700">);
|
|
|
74 |
<BR></FONT><FONT color="#0000BB">$activity</FONT><FONT color="#007700">
|
|
|
75 |
-></FONT><FONT color="#0000BB">rightMark</FONT><FONT color="#007700">-></FONT><FONT
|
|
|
76 |
color="#0000BB">title</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">
|
|
|
77 |
SetColor</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">
|
|
|
78 |
"white"</FONT><FONT color="#007700">);</FONT><FONT color="#0000BB"></FONT>
|
|
|
79 |
</FONT></CODE></DIV></P>
|
|
|
80 |
<P> This might seem like a lot of lines but this is as complicated as it
|
|
|
81 |
possible can get. As an illustration in the example belwo more or less
|
|
|
82 |
everything that is changeable has been changed, the default font,
|
|
|
83 |
font-color, fill-color, frame-color and width of marker. The two lines
|
|
|
84 |
only really necessary are the first two, showing the mark and setting a
|
|
|
85 |
title. One could still get a good result by using default values for
|
|
|
86 |
the rest of the properties.</P>
|
|
|
87 |
<P> The resulting image can be seen in Figure 155 below.<DIV class="example">
|
|
|
88 |
<BR> <A href="exframes/frame_ganttex08.html" target="blank"><IMG border="0"
|
|
|
89 |
HEIGHT="243" src="img/img/img/img/img/img/ganttex08.png" WIDTH="502"></A>
|
|
|
90 |
<BR><B>Figure 155:</B> Adding a right marker to a bar. <A href="exframes/frame_ganttex08.html"
|
|
|
91 |
target="blank">[src]</A>
|
|
|
92 |
<P></P>
|
|
|
93 |
</DIV></P>
|
|
|
94 |
<P> We have deliberately introduced a "strangeness" here. If the
|
|
|
95 |
previous two examples are compared it can bee seen that the last
|
|
|
96 |
example is larger than the previous one. Why?</P>
|
|
|
97 |
<P> The explanation is trivial once we recall that the height of bars
|
|
|
98 |
are sized relative to the horizontal spacing. The horizontal spacing
|
|
|
99 |
are based on the highest single bar including title size and, here come
|
|
|
100 |
the explanation, marker size. The horizontal spacing has grown since
|
|
|
101 |
the minimum height is now based on 10 points(=the height of the mark).
|
|
|
102 |
The bar still occupy the same percentage of the height so it seems to
|
|
|
103 |
have grown.</P>
|
|
|
104 |
<P> If this behavior is unwanted it is always possible to specify an
|
|
|
105 |
absolute size for the bar heigh, say 8 pixels, with a call<DIV class="phpscript">
|
|
|
106 |
<CODE><FONT color="#000000"> <FONT color="#0000BB"> $activity</FONT><FONT
|
|
|
107 |
color="#007700">-></FONT><FONT color="#0000BB">SetHeight</FONT><FONT color="#007700">
|
|
|
108 |
(</FONT><FONT color="#0000BB">8</FONT><FONT color="#007700">);</FONT><FONT
|
|
|
109 |
color="#0000BB"></FONT></FONT></CODE></DIV></P>
|
|
|
110 |
<P> and achieve the result in Figure 156 below.<DIV class="example">
|
|
|
111 |
<BR> <A href="exframes/frame_ganttex09.html" target="blank"><IMG border="0"
|
|
|
112 |
HEIGHT="243" src="img/img/img/img/img/img/ganttex09.png" WIDTH="502"></A>
|
|
|
113 |
<BR><B>Figure 156:</B> Specifying an absolute size for the height of the
|
|
|
114 |
bar. <A href="exframes/frame_ganttex09.html" target="blank">[src]</A>
|
|
|
115 |
<P></P>
|
|
|
116 |
</DIV></P>
|
|
|
117 |
<P> It is worth noting that the height reserved for each bar is still
|
|
|
118 |
the same since we haven't changed the height of the marker and the
|
|
|
119 |
reserved space is the maximum height used by any bar.</P>
|
|
|
120 |
<HR NOSHADE>
|
|
|
121 |
<A HREF="toc.html">Contents</A>
|
|
|
122 |
<A HREF="974Verticalline.html">Previous</A>
|
|
|
123 |
<A HREF="976Adjustingtheminimumdistancebetweenbars.html">Next</A>
|
|
|
124 |
</BODY>
|
|
|
125 |
</HTML>
|