The GANTT Procedure

ODS Style Templates

ODS style templates, or styles, control the overall look of your output. An ODS style template consists of a set of style elements. A style element is a collection of style attributes that apply to a particular feature or aspect of the output. You can specify a value for each attribute in a style. See Chapter 21: Statistical Graphics Using ODS in SAS/STAT User's Guide, for a thorough discussion of ODS Graphics.

To create your own style or to modify a style for use with ODS Graphics, you need to understand the relationships between style elements and graph features. This information is provided in the ODS Graphics documentation at http://support.sas.com/documentation/onlinedoc/base/ . You can create and modify style templates with the TEMPLATE procedure. For more information, see the section TEMPLATE Procedure: Creating a Style Template in the SAS Output Delivery System: User's Guide. Kuhfeld (2010) also offers detailed information and examples.

PROC GANTT Style Template

A predefined ODS style template named GANTT is available for the GANTT procedure. You can use the template to maintain a consistent appearance in all graphical output produced by the procedure.

To change the current style, specify the STYLE= option in an ODS destination statement. The specified style is applied to all output for that destination until you change or close the destination or start a new SAS session. For example, the following statement specifies that ODS should apply the GANTT style template to all HTML output:

ods html style=gantt;

To disable the use of graphical styles, specify the SAS system option NOGSTYLE.

The parent style template for the GANTT style is the DEFAULT style. Table 8.13 lists the style elements (in bold) and corresponding attributes specified in the GANTT style. The table also indicates which (if any) PROC GANTT options or graphics options (in a GOPTIONS statement) can be used to override the value of a style attribute.

Table 8.13: Style Elements and Attributes in the GANTT Style

Element/Attributes

Description

GANTT Option

GOPTION

GraphColors

Colors of various graph features

PATTERN=

CPATTERN=, COLORS=

gdata1

Duration of a noncritical activity

PATTERN=

CPATTERN=, COLORS=

gdata2

Slack time for a noncritical activity

PATTERN=

CPATTERN=, COLORS=

gdata3

Duration of a critical activity

PATTERN=

CPATTERN=, COLORS=

gdata4

Slack time for a supercritical activity

PATTERN=

CPATTERN=, COLORS=

gdata5

Duration of a supercritical activity

PATTERN=

CPATTERN=, COLORS=

gdata6

Actual duration of an activity

PATTERN=

CPATTERN=, COLORS=

gdata7

Break due to a holiday

PATTERN=

CPATTERN=, COLORS=

gdata8

Resource-constrained duration of an activity

PATTERN=

CPATTERN=, COLORS=

gdata9

Baseline duration of an activity

PATTERN=

CPATTERN=, COLORS=

gaxis

Axis

CAXIS=

COLORS=

ggrid

Horizontal connecting lines, zone lines

CHCON=, CZONE=

COLORS=

gdata

Default

 

COLORS=

gcdata

Precedence connections

CPREC=

COLORS=

greferencelines

Reference and timenow lines

CREF=, CTNOW=

COLORS=

gtextt

Title text

 

CTITLE=

gtext

Text

 

CTEXT=

glabel

Labels

 

COLORS=

GraphFonts

Fonts for various graph features

 

GraphDataFont

Default

 

FONT=

GraphLabelFont

Labels

 

FONT=

GraphTitleFont

Title text

 

FTITLE=

GraphAxisLines

Attributes related to graph axes

 

Color

GraphColors('gaxis')

CAXIS=

COLORS=

GraphGridLines

Attributes related to horizontal connecting lines and zone lines

 

Color

GraphColors('ggrid')

CHCON=, CZONE=

COLORS=

GraphConnectLine

Attributes related to precedence connections

 

Color

GraphColors('gcdata')

CPREC=

COLORS=

GraphReference

Attributes related to reference and timenow lines

 

Color

GraphColors('greferencelines')

CREF=, CTNOW=

COLORS=

GraphDataText

Attributes related to general text

 

Color

GraphColors('gtext')

CTEXT=

COLORS=

Font

GraphFonts('GraphDataFont')

FONT=

FONT=

GraphTitleText

Attributes related to title text

 

Color

GraphColors('gtextt')

 

CTITLE=

Font

GraphFonts('GraphTitleFont')

 

FTITLE=

GraphLabelText

Attributes related to label text

 

Color

GraphColors('glabel')

_CLABEL variable in the LABDATA= data set

COLORS=

Font

GraphFonts('GraphLabelFont')

_FLABEL variable in the LABDATA= data set

FONT=

GraphDataDefault

Default values for the attributes specified in Table 8.14

 

Color

GraphColors('gdata')

 

COLORS=


Attributes that you do not override retain the values specified in the style template.

Figure 8.15 demonstrates features of the GANTT graphical style. The GANTT chart in the figure is the first output from Example 8.11.

Figure 8.15: GANTT Style Template: Example


Default Values

If the SAS system option GSTYLE is in effect (this is the default), then the default values of certain PROC GANTT options can depend on the current ODS style template. Table 8.14 lists these PROC GANTT options and lists the order in which PROC GANTT searches for each option’s default value. The order assumes that the GSTYLE system option is in effect; if that is not the case, then the steps that refer to ODS style templates are ignored. Names with arguments indicate style elements and attributes of the current ODS style template. For example, GraphAxisLines('Color') refers to the Color attribute of the GraphAxisLines element.

Table 8.14: PROC GANTT Options: Search Orders for Default Values

Option

 

Search Order for Default Color

CAXIS=

1.

The Color attribute of the GraphAxisLines element of the current ODS style template

 

2.

The Color attribute of the GraphDataDefault element of the current ODS style template

 

3.

The first color in the COLORS= list in the GOPTIONS statement

CFRAME=

1.

No color filling the axis area (if the GSTYLE system option is not in effect)

 

2.

The Color attribute of the GraphWalls element of the current ODS style template

 

3.

No color filling the axis area

CHCON=

1.

The Color attribute of the GraphGridLines element of the current ODS style template

 

2.

The Color attribute of the GraphDataDefault element of the current ODS style template

 

3.

The first color in the COLORS= list in the GOPTIONS statement

CPREC=

1.

The Color attribute of the GraphConnectLine element of the current ODS style template

 

2.

The Color attribute of the GraphDataDefault element of the current ODS style template

 

3.

The first color in the COLORS= list in the GOPTIONS statement

CREF=

1.

The Color attribute of the GraphReference element of the current ODS style template

 

2.

The Color attribute of the GraphDataDefault element of the current ODS style template

 

3.

The first color in the COLORS= list in the GOPTIONS statement

CTEXT=

1.

The value specified for the CTEXT= option in the GOPTIONS statement

 

2.

The Color attribute of the GraphDataText element of the current ODS style template

 

3.

The Color attribute of the GraphDataDefault element of the current ODS style template

 

4.

The first color in the COLORS= list in the GOPTIONS statement

CTNOW=

1.

The Color attribute of the GraphReference element of the current ODS style template

 

2.

The Color attribute of the GraphDataDefault element of the current ODS style template

 

3.

The first color in the COLORS= list in the GOPTIONS statement

CZONE=

1.

The Color attribute of the GraphGridLines element of the current ODS style template

 

2.

The Color attribute of the GraphDataDefault element of the current ODS style template

 

3.

The first color in the COLORS= list in the GOPTIONS statement

FONT=

1.

The value specified for the FTEXT= option in the GOPTIONS statement

 

2.

The Font attribute of the GraphDataText element of the current ODS style template

 

3.

The default hardware font for the graphics output device