| 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="975Addingmarkerstoaganttbar.html">
|
|
|
8 |
<LINK REL="Next" HREF="98Formattingthescaleheaders.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="975Addingmarkerstoaganttbar.html">Previous</A>
|
|
|
26 |
<A HREF="98Formattingthescaleheaders.html">Next</A>
|
|
|
27 |
<HR NOSHADE>
|
|
|
28 |
<H3><A NAME="9_7_6">9.7.6 Adjusting the minimum distance between bars</A>
|
|
|
29 |
</H3>
|
|
|
30 |
<P> Let's see what happens if we set the height of each bar to be 100%
|
|
|
31 |
of the reserved height by adding another activity/bar below the first
|
|
|
32 |
one and set the height of each bar to 100% by adding the lines (We omit
|
|
|
33 |
the added lines to add another bar since they are just a copy of the
|
|
|
34 |
first bar)<DIV class="phpscript"><CODE><FONT color="#000000"> <FONT color="#0000BB">
|
|
|
35 |
$activity</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">
|
|
|
36 |
SetHeight</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">1.0</FONT><FONT
|
|
|
37 |
color="#007700">);
|
|
|
38 |
<BR></FONT><FONT color="#0000BB">$activity2</FONT><FONT color="#007700">
|
|
|
39 |
-></FONT><FONT color="#0000BB">SetHeight</FONT><FONT color="#007700">(</FONT><FONT
|
|
|
40 |
color="#0000BB">1.0</FONT><FONT color="#007700">);</FONT><FONT color="#0000BB">
|
|
|
41 |
</FONT></FONT></CODE></DIV></P>
|
|
|
42 |
<P> to the previous example. (Note that a value in the range [0..1] is
|
|
|
43 |
interpretated as the fraction of the reserved height while a value > 1
|
|
|
44 |
is interpretated as the absolute size in pixels.)<DIV class="example">
|
|
|
45 |
<BR> <A href="exframes/frame_ganttex10.html" target="blank"><IMG border="0"
|
|
|
46 |
HEIGHT="243" src="img/img/img/img/img/img/ganttex10.png" WIDTH="502"></A>
|
|
|
47 |
<BR><B>Figure 157:</B> Setting the height for each bar to 100% <A href="exframes/frame_ganttex10.html"
|
|
|
48 |
target="blank">[src]</A>
|
|
|
49 |
<P></P>
|
|
|
50 |
</DIV></P>
|
|
|
51 |
<P> Aha.. What we are trying to do doesn't really make sense. Since we
|
|
|
52 |
have specified that the bar will always occupy 100% of the available
|
|
|
53 |
reserved with there will be no distance between the bars. So what if we
|
|
|
54 |
specify the bar as 10 pixel absolute by changing the lines to<DIV class="phpscript">
|
|
|
55 |
<CODE><FONT color="#000000"> <FONT color="#0000BB"> $activity</FONT><FONT
|
|
|
56 |
color="#007700">-></FONT><FONT color="#0000BB">SetHeight</FONT><FONT color="#007700">
|
|
|
57 |
(</FONT><FONT color="#0000BB">10</FONT><FONT color="#007700">);
|
|
|
58 |
<BR></FONT><FONT color="#0000BB">$activity2</FONT><FONT color="#007700">
|
|
|
59 |
-></FONT><FONT color="#0000BB">SetHeight</FONT><FONT color="#007700">(</FONT><FONT
|
|
|
60 |
color="#0000BB">10</FONT><FONT color="#007700">);</FONT><FONT color="#0000BB">
|
|
|
61 |
</FONT></FONT></CODE></DIV></P>
|
|
|
62 |
<P> we instead get<DIV class="example">
|
|
|
63 |
<BR> <A href="exframes/frame_ganttex11.html" target="blank"><IMG border="0"
|
|
|
64 |
HEIGHT="243" src="img/img/img/img/img/img/ganttex11.png" WIDTH="502"></A>
|
|
|
65 |
<BR><B>Figure 158:</B> Setting both bars height to 10 pixels <A href="exframes/frame_ganttex11.html"
|
|
|
66 |
target="blank">[src]</A>
|
|
|
67 |
<P></P>
|
|
|
68 |
</DIV></P>
|
|
|
69 |
<P> So what can we actually do? Well if you remember the reserved height
|
|
|
70 |
for each bar is the maximum height of all bars including titles. This
|
|
|
71 |
guarantees that no two bars will ever overlap. To guarantee that titles
|
|
|
72 |
don't end up too close together there is a<B> Vertical Label Margin</B>
|
|
|
73 |
which basically specifies some extra "air" in between the titles. The
|
|
|
74 |
amount of air is specified in percent of the title height. To set the
|
|
|
75 |
margin you use<DIV class="phpscript"><CODE><FONT color="#000000"> <FONT color="#0000BB">
|
|
|
76 |
GanttGraph</FONT><FONT color="#007700">::</FONT><FONT color="#0000BB">
|
|
|
77 |
SetLabelVMarginFactor</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">
|
|
|
78 |
$aMargin</FONT><FONT color="#007700">)</FONT><FONT color="#0000BB"></FONT>
|
|
|
79 |
</FONT></CODE></DIV></P>
|
|
|
80 |
<P> As an example let's set that margin in the previous example to 0 and
|
|
|
81 |
see what happens.<DIV class="example">
|
|
|
82 |
<BR> <A href="exframes/frame_ganttex12.html" target="blank"><IMG border="0"
|
|
|
83 |
HEIGHT="212" src="img/img/img/img/img/img/ganttex12.png" WIDTH="502"></A>
|
|
|
84 |
<BR><B>Figure 159:</B> Setting the vertical label margin to 0% <A href="exframes/frame_ganttex12.html"
|
|
|
85 |
target="blank">[src]</A>
|
|
|
86 |
<P></P>
|
|
|
87 |
</DIV></P>
|
|
|
88 |
<P> As you would perhaps expect the two bars just barely touches now
|
|
|
89 |
since there are no extra margin added. If the two bars hadn't had the
|
|
|
90 |
extra right marker it would have looked very compressed.</P>
|
|
|
91 |
<P> By default the vertical margin is set to 40%.</P>
|
|
|
92 |
<HR NOSHADE>
|
|
|
93 |
<A HREF="toc.html">Contents</A>
|
|
|
94 |
<A HREF="975Addingmarkerstoaganttbar.html">Previous</A>
|
|
|
95 |
<A HREF="98Formattingthescaleheaders.html">Next</A>
|
|
|
96 |
</BODY>
|
|
|
97 |
</HTML>
|