| 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="1014AddingCSIMClientsideImageMapstoGanttcharts.html">
|
|
|
8 |
<LINK REL="Next" HREF="1016Advancedformatting.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="1014AddingCSIMClientsideImageMapstoGanttcharts.html">Previous</A>
|
|
|
26 |
<A HREF="1016Advancedformatting.html">Next</A>
|
|
|
27 |
<HR NOSHADE>
|
|
|
28 |
<H2><A NAME="10_15">10.15 Adding constrains between your activities</A></H2>
|
|
|
29 |
<P> With Gantt charts there is often the need to illustrate constrains
|
|
|
30 |
between one or several activities. One of the most common constrain is
|
|
|
31 |
that on activity can't start before an other activity finish.</P>
|
|
|
32 |
<P> JpGraph support visualizing the following types of constrains</P>
|
|
|
33 |
<UL>
|
|
|
34 |
<LI> Start to End</LI>
|
|
|
35 |
<LI> Start to Start</LI>
|
|
|
36 |
<LI> End to Start</LI>
|
|
|
37 |
<LI> End to End</LI>
|
|
|
38 |
</UL>
|
|
|
39 |
<P> An example will clarify how to specify a constrain between two
|
|
|
40 |
activities.</P>
|
|
|
41 |
<P> Assume that we start with the Gantt schema as illustrated below<DIV class="example">
|
|
|
42 |
<BR> <A href="exframes/frame_ganttconstrainex0.html" target="blank"><IMG border="0"
|
|
|
43 |
HEIGHT="231" src="img/ganttconstrainex0.png" WIDTH="523"></A>
|
|
|
44 |
<BR><B>Figure 167:</B> The original Gantt schema we wich to add
|
|
|
45 |
constrains to <A href="exframes/frame_ganttconstrainex0.html" target="blank">
|
|
|
46 |
[src]</A>
|
|
|
47 |
<P></P>
|
|
|
48 |
</DIV></P>
|
|
|
49 |
<P> We would now like to add the constrains that the activity "Label 3"
|
|
|
50 |
cant start before activity "Label 2" has finished and that the
|
|
|
51 |
milestone "Phase 1 done" is depending on when activity "Label 3" is
|
|
|
52 |
done.</P>
|
|
|
53 |
<P> The principle of adding constrains is that you for each activity you
|
|
|
54 |
want to have a constrain you have to tell to what other activity this
|
|
|
55 |
constrain should be to. That other activity is specified by telling on
|
|
|
56 |
what row that activity lies. Depending on what type of constrain, e.g.
|
|
|
57 |
Start-to-End, an arrow will now connect the two activities in correct
|
|
|
58 |
way.</P>
|
|
|
59 |
<P> The way to do this is to call the <A href="../ref/GanttPlotObject.html#_GANTTPLOTOBJECT_SETCONSTRAIN">
|
|
|
60 |
SetConstrain()</A> method on the activity. In this method you specify
|
|
|
61 |
the type of constrain as well as to what other activity this constrain
|
|
|
62 |
should be to. If you read the class reference you can also see that you
|
|
|
63 |
can specify the type and size of arrow used. For now we will just use
|
|
|
64 |
the default sizes and type.</P>
|
|
|
65 |
<P> So for example to add an End-To-Start constrain between "Label 2"
|
|
|
66 |
and "Label 3" you could write<DIV class="phpscript"><CODE><FONT color="#000000">
|
|
|
67 |
<FONT color="#0000BB"> $bar2</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">
|
|
|
68 |
SetConstrain</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">2</FONT><FONT
|
|
|
69 |
color="#007700">,</FONT><FONT color="#0000BB">CONSTRAIN_ENDSTART</FONT><FONT
|
|
|
70 |
color="#007700">)</FONT><FONT color="#0000BB"></FONT></FONT></CODE></DIV>
|
|
|
71 |
</P>
|
|
|
72 |
<P> The first parameter in the call above "2" is the row of the target
|
|
|
73 |
activity (i.e. the row where "Label 3") activity is. In the example
|
|
|
74 |
below we have added the constrains we wanted.<DIV class="example">
|
|
|
75 |
<BR> <A href="exframes/frame_ganttconstrainex1.html" target="blank"><IMG border="0"
|
|
|
76 |
HEIGHT="253" src="img/ganttconstrainex1.png" WIDTH="523"></A>
|
|
|
77 |
<BR><B>Figure 168:</B> Adding constrains to a gantt chart <A href="exframes/frame_ganttconstrainex1.html"
|
|
|
78 |
target="blank">[src]</A>
|
|
|
79 |
<P></P>
|
|
|
80 |
</DIV></P>
|
|
|
81 |
<P> A note: The actual path followed by the arrow is controlled by some
|
|
|
82 |
heuristics to make it clear what the constrain is. It has been a design
|
|
|
83 |
decision that in order to keep the API simple the user has no further
|
|
|
84 |
detailed controlled on the actual path followed. However, in future
|
|
|
85 |
version the heuristics may be extended and provide some
|
|
|
86 |
user-controllable parameters.</P>
|
|
|
87 |
<HR NOSHADE>
|
|
|
88 |
<A HREF="toc.html">Contents</A>
|
|
|
89 |
<A HREF="1014AddingCSIMClientsideImageMapstoGanttcharts.html">Previous</A>
|
|
|
90 |
<A HREF="1016Advancedformatting.html">Next</A>
|
|
|
91 |
</BODY>
|
|
|
92 |
</HTML>
|