The GANTT Procedure

Example 8.19 Specifying the Logic Control Options

This example illustrates four options that control the routing of a precedence connection from an activity to its successor on the logic Gantt chart. The example also illustrates the drawing of a Logic Gantt chart using the Activity-on-Arc format.

The Activity data set for PROC CPM is the WIDGETA data set from Example 4.2, which defines the widget manufacturing project in AOA format. The project is scheduled subject to weekends, and the holidays are defined in the HOLDATA data set. The resulting schedule is stored in the output data set SAVEHP. The GANTT procedure is next invoked to produce a Logic Gantt chart by specifying the HEAD= and TAIL= options in the CHART statement. The resulting Logic Gantt chart is shown in Output 8.19.1.

title h=1.75 'Gantt Example 19';
data holdata;
   format hol date7.;
   input hol & date7.;
   datalines;
25dec03
01jan04
;
* schedule the project subject to holidays and weekends;
proc cpm data=widgeta holidata=holdata out=savehp
         date='1dec03'd interval=weekday;
   tailnode tail;
   headnode head;
   duration days;
   holiday  hol;
   id task dept descrpt;
   run;

* sort the schedule by the early start date;
proc sort;
   by e_start;
   run;

* set background to white and text to black;
goptions cback=white ctext=black;

* set additional graphics options;
goptions vpos=50 hpos=100 htext=1.1;
 * plot the logic Gantt chart using AOA representation;
title2 h=1.25 'Logic Gantt Chart: AOA Representation';

proc gantt graphics data=savehp holidata=holdata;
   chart / compress cprec=blue caxis=black cmile=cyan
           increment=7 height=1.5
           dur=days holiday=(hol)
           head=head tail=tail;
   id task;
   run;

Output 8.19.1: Logic Gantt Chart: AOA Representation

Logic Gantt Chart: AOA Representation


The next invocation of PROC GANTT illustrates the effect of the MININTGV= and MINOFFGV= options, which control placement of the global verticals. The concept of global verticals is explained in the section Specifying the Logic Options. The data sets from the previous invocation of the GANTT procedure remain unchanged. The minimum distance of a global vertical from the end of the bar it is associated with is increased from its default of 1 cell to 2.5 cells by specifying MINOFFGV=2.5. Likewise, the minimum distance between any two global verticals is increased from its default of .75 cells to 2 cells by specifying MININTGV=2.0. The effects of these changes are visible in the resulting Logic Gantt chart shown in Output 8.19.2.

goptions htext=1.4;

* illustrate the minintgv and minoffgv options;
title2 h=1.25
   'Logic Gantt Chart: AOA Representation, MININTGV=2 and MINOFFGV=2.5';

proc gantt graphics data=savehp holidata=holdata;
   chart / dur=days holiday=(hol) compress increment=7
           cprec=blue caxis=black cmile=cyan
           head=head tail=tail
           minintgv=2.0 minoffgv=2.5;
   id task;
   run;

Notice that now there is greater distance between vertical segments (corresponding to global verticals), and the horizontal segments leaving bars are longer.

Output 8.19.2: Specifying the MININTGV= and MINOFFGV= Options

Specifying the MININTGV= and MINOFFGV= Options


The MAXDATE= option is specified in the remaining Gantt calls in this example in order to focus on the schedule bars of the first few activities in the chart. The next two outputs illustrate the use of the MAXDISLV= option in the CHART statement. The MAXDISLV= option is used as a safeguard to limit the feasible region made available to PROC GANTT for placement of local verticals. The value specified dictates the maximum allowable displacement of the local vertical from its ideal position, that is, at a distance of MINOFFLV= from the end of the bar with which it is associated. However, this ideal position may tend to be positioned too close to a global vertical or even coincide with one. Depending on the cell width, this can result in visual misinterpretation of the Logic Gantt chart. In order to avoid this scenario, you should specify a reasonable value for the MAXDISLV= option to permit a certain amount of freedom for local vertical placement so as to distinguish between local and global verticals. Typically, use of this option is desirable when the value of the MININTGV= option, the minimum distance between global verticals, is relatively much greater than the value of the MAXDISLV= option.

To illustrate, consider the following Gantt call with a large MININTGV= value (10) and a relatively smaller MAXDISLV= value (0.3). Thus, for every local vertical, PROC GANTT has a very small interval that is less than a third of a cell wide in which to place that local vertical regardless of whether a global vertical runs through that interval or not. The result of this constraint is illustrated in the chart shown in Output 8.19.3. The local vertical for 'Drawings' is positioned as far as possible from the global vertical of 'Approve Plan,' but the value of the MAXDISLV= option restricts it from being positioned any further. Visually it is not pleasing, and it is difficult to distinguish the local and global verticals. A similar situation is evident with the local vertical of 'Prototype' and the global vertical of 'Write Specs.'

goptions htext=1.2;

* illustrate the maxdislv option;
title2 h=1.25 'Logic Gantt Chart: AOA Representation and MAXDISLV=.3';

proc gantt graphics data=savehp holidata=holdata;
   chart / compress cprec=blue caxis=black cmile=cyan
           dur=days holiday=(hol)
           head=head tail=tail
           maxdislv=.3 minintgv=10
           maxdate='01feb04'd;
   id task;
   run;

Output 8.19.3: Specifying the MAXDISLV= Option (I)

Specifying the MAXDISLV= Option (I)


By reducing the value of MAXDISLV= even further, you can produce a chart that gives the appearance of a local vertical overlapping with a global vertical owing to resolution limitations of the display device. Theoretically, by design, this will never be the case. Recall that the value of the MAXDISLV= option is strictly positive and is at least one-tenth of a cell width.

The solution to this problem is to increase the value of the MAXDISLV= option so that the local vertical can be displaced further away from any adjacent global verticals. In the next invocation of PROC GANTT, the value of the MAXDISLV= option is increased to 2, resulting in a Logic Gantt chart in which the local verticals are staggered further away from nearby global verticals. This Gantt chart is displayed in Output 8.19.4.

title2 h=1.25 'Logic Gantt Chart: AOA Representation and MAXDISLV=2';

proc gantt graphics data=savehp holidata=holdata;
   chart / compress cprec=blue caxis=black cmile=cyan
           dur=days holiday=(hol)
           head=head tail=tail
           maxdislv=2 minintgv=10
           maxdate='01feb04'd;
   id task;
   run;

Output 8.19.4: Specifying the MAXDISLV= Option (II)

Specifying the MAXDISLV= Option (II)


The final Gantt chart in this example illustrates the use of the MINOFFLV= option in the CHART statement. This option specifies the minimum distance of a local vertical from the end of the bar with which it is associated. Although the position corresponding to the MINOFFLV= option is the position of choice for placement of the local vertical, the actual placement can differ from this position owing to the presence of nearby global verticals, as illustrated by Output 8.19.3 and Output 8.19.4. The maximum amount of displacement is determined by the value of the MAXDISLV= option.

In all of the preceding charts in this example, the connection from the activity, 'Approve Plan,' to each of its three successors, 'Drawings', 'Study Market', and 'Write Specs', is a 5-segment connection similar to the type illustrated in Figure 8.14. This is caused by backtracking of the activity’s global vertical to the successor’s local vertical as described in the section Controlling the Layout. To transform this connection into a 3-segment connection as shown in Figure 8.13, you need to position the local vertical to the right of the global vertical. The following invocation of PROC GANTT achieves this by specifying MINOFFLV=0.5, and the resulting Gantt chart is shown in Output 8.19.5. Notice that this option affects the positioning of all local verticals on the chart in contrast to the MAXDISLV= option, which affects only those local verticals that are close to global verticals.

* illustrate the minofflv option;
title2 h=1.25
   'Logic Gantt Chart: AOA Representation and MINOFFLV=.5';

proc gantt graphics data=savehp holidata=holdata;
   chart / compress cprec=blue caxis=black cmile=cyan
           dur=days holiday=(hol)
           head=head tail=tail
           minofflv=.5
           maxdate='01feb04'd;
   id task;
   run;

Output 8.19.5: Specifying the MINOFFLV= Option

Specifying the MINOFFLV= Option