The GANTT Procedure

 

Example 8.17 Using the HEIGHT= and HTOFF= Options

The following example illustrates two options that control the height and positioning of all text produced by PROC GANTT. The data used for this example come from Example 8.13, which illustrates plotting of the resource-constrained schedule. PATTERN statements are specified in order to identify the fill patterns for the different schedule types and holidays. The resource-constrained schedule is drawn using the fill pattern from the eighth PATTERN statement. The HEIGHT= option is set to 2, indicating that the height of all text produced by PROC GANTT be equal to the height of two activity bars. This text includes activity text, legend text, and axis labeling text. The HTOFF= option is also set to 2, which drops the font baseline of the activity text by the height of one schedule bar causing the font baseline to be positioned at the bottom of the resource-constrained schedule bar. The resulting Gantt chart is displayed in Output 8.17.1.

title 'Gantt Example 17';
* set up required pattern statements;

pattern1 c=blue v=s;   /* duration of a non-critical activity   */
pattern2 c=blue v=e;   /* slack time for a noncrit. activity    */
pattern3 c=red v=s;    /* duration of a critical activity       */
pattern4 c=red v=e;    /* slack time for a supercrit. activity  */
pattern5 c=red v=r2;   /* duration of a supercrit. activity     */
pattern6 c=cyan v=s;   /* actual duration of an activity        */
pattern7 c=blue v=r1;  /* break due to a holiday                */
pattern8 c=red v=x1;   /* resource schedule of activity         */
pattern9 c=blue v=s;   /* baseline schedule of activity         */

* set vpos to 50 and hpos to 100;
goptions vpos=50 hpos=100;

title2 'Using the HEIGHT= and HTOFF= options';

* draw Gantt chart using height and htoff equal to 2;
proc gantt graphics data=spltschd holidata=holdata;
   chart / holiday=(hol) dur=days compress cmile=green caxis=black
           height=2 htoff=2;
   id task;
   run;

Output 8.17.1 Using the HEIGHT= and HTOFF= options
Using the HEIGHT= and HTOFF= options