| TEMPLATE Procedure: ODS Graphics Overview (Experimental) |
| Getting Familiar with ODS Graphics and Style References |
An ODS style definition is composed 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. A value is specified for each attribute in a style definition.
Style definitions control the overall appearance of ODS tables and graphs. For ODS graphs, style definitions specify the following features:
background color
graph dimensions (height and width)
borders
line styles for axes and grid lines
fonts, sizes, and colors for titles, footnotes, axis labels, axis values, and data labels
marker symbols, colors, and sizes for data points and outliers
line styles for needles
line and curve styles for fitted models and predicted values
line and curve styles for confidence and prediction limits
fill colors for histogram bars, confidence bands, and confidence ellipses
colors for box plot features
color for surfaces
color ramps for contour plots
In the ODS statistical graph definitions that SAS provides, options for plot features are specified with a style reference in the form style-element:attribute, rather than a specific value. For example, the symbol, color, and size of markers for a basic scatter plot is specified in a SCATTERPLOT statement as follows:
scatterplot x=X y=Y/ markersymbol=GraphDataDefault:markersymbol markercolor=GraphDataDefault:contrastcolor markersize=GraphDataDefault:markersize
The above style references guarantee a common appearance for markers used in all basic scatter plots, which is controlled by the GraphDataDefault element of the style definition that you specify.
In order to create your own style definition, or to modify a style definition to use with ODS Graphics, you need to understand the relationship between style elements and graph features. For more information, see "ODS Statistical Graphics and ODS Styles: Usage and Reference (Experimental)" at http://support.sas.com/documentation/onlinedoc/base/.
Style definitions are created and modified with the TEMPLATE procedure. For more information, see "TEMPLATE Procedure: Creating a Style Definition" in SAS Output Delivery System: User's Guide
| Style Elements for ODS Graphics |
The following table lists the ODS Graphics style elements. For information about ODS Graphics and style definitions, see "ODS Statistical Graphics and ODS Styles: Usage and Reference (Experimental)" at http://support.sas.com/documentation/onlinedoc/base/.
| Style Element | Affected Graph Feature | Valid Style Attributes |
|---|---|---|
| Graph | graph size and border around it | CELLPADDING CELLSPACING BORDERCOLOR BORDERWIDTH OUTPUTWIDTH OUTPUTHEIGHT |
| GraphAxisLines | axis lines | FOREGROUND LINESTYLE LINETHICKNESS THRESHOLD |
| GraphAxisTickMarks | axis tick marks | FOREGROUND TICKDISPLAY MINOR |
| GraphBackground | background of the graph | BACKGROUND |
| GraphBorderLines | frame around axis area and legend | FOREGROUND LINESTYLE LINETHICKNESS |
| GraphDataDefault | graphics primitives related to non-grouped data items | FOREGROUND CONTRASTCOLOR TRANSPARENCY MARKERSYMBOL MARKERSIZE LINESTYLE LINETHICKNESS |
| GraphData1-GraphData12 | graphics primitives related to grouped data items | FOREGROUND CONTRASTCOLOR TRANSPARENCY MARKERSYMBOL LINESTYLE |
| GraphDataText | text for data point/curve label, reference line label | FONT FOREGROUND |
| GraphFloor | floor color | BACKGROUND TRANSPARENCY |
| GraphFootnoteText | text for graph footnote(s) | FONT FOREGROUND |
| GraphGridLines | grid lines | FOREGROUND LINESTYLE LINETHICKNESS |
| GraphHeaderBackground | background color of headers including legend | BACKGROUND TRANSPARENCY |
| GraphLabelText | text for axis labels and legend title | FONT FOREGROUND |
| GraphLegendBackground | background color of the legend | BACKGROUND TRANSPARENCY |
| GraphOutlines | lines that outline bars, ellipses, bands and other graphical displays | FOREGROUND LINESTYLE LINETHICKNESS |
| GraphTitleText | text font for title(s) | FONT FOREGROUND |
| GraphValueText | text for axis tick values and legend entries | FONT FOREGROUND |
| GraphWalls | wall color | BACKGROUND TRANSPARENCY |
| ThreeColorAltRamp | contours and surfaces with continuous response | STARTCOLOR ENDCOLOR NEUTRALCOLOR |
| ThreeColorRamp | contours and surfaces with continuous response | STARTCOLOR ENDCOLOR NEUTRALCOLOR |
| ODS Graphics Style Attributes |
The following table lists the ODS graphics style attributes. For information about ODS Graphics and style definitions, see "ODS Statistical Graphics and ODS Styles: Usage and Reference (Experimental)" at http://support.sas.com/documentation/onlinedoc/base/.
| Style Attribute | Data Value Type | Affected Graph Feature | Examples |
|---|---|---|---|
| BACKGROUND | color | background color of the graph, walls, or floor |
BACKGROUND=colors ('docbg')
BACKGROUND=blue |
| BORDERCOLOR | color | color of border | BORDERCOLOR=blue |
| BORDERWIDTH | dimension | width of the border | BORDERWIDTH=10 |
| CELLPADDING | dimension or % | amount of white space around area | CELLPADDING=2% |
| CELLSPACING | dimension | thickness of spacing between areas | CELLSPACING=5 |
| CONTRASTCOLOR | color | alternate color where contrast is needed | CONTRASTCOLOR=red |
| ENDCOLOR | color: final color used with 3-color ramp | contours, gradient legends | ENDCOLOR=red |
| FONT | aggregate definition in parentheses | all text font attributes | FONT= (" 'Courier New', Courier, monospace", 4 ,medium, roman) |
| FONT_FACE | string | font face | FONT_FACE= "Courier New" |
| FONT_SIZE | dimension or % | font size | FONT_SIZE= 10pt |
| FONT_STYLE | string: italic, roman, slant | font style | FONT_STYLE= italic |
| FONT_WEIGHT | string: light, medium, bold | font weight | FONT_WEIGHT= bold |
| FOREGROUND | color | color of line or text | FOREGROUND= colors('docfg') |
| LINECOLOR | color | color of line |
LINECOLOR= GraphColors("gdata1")
LINECOLOR= blue |
| LINESTYLE |
integer:
1= solid line
2-46= dash/dot line |
borders, axis lines, grid, reference, model, confidence lines | LINESTYLE= 2 |
| LINETHICKNESS | dimension or % | width thickness of line |
LINETHICKNESS= 2px
LINETHICKNESS= 2% |
| MARKERCOLOR | color | color of marker |
MARKERCOLOR= GraphColors("gdata1")
MARKERCOLOR= "blue" |
| MARKERSIZE | dimension or % | marker size |
MARKERSIZE= 5px
MARKERSIZE= 3% |
| MARKERSYMBOL | string | marker used |
MARKERSYMBOL= "circle"
MARKERSYMBOL= "starfilled star" |
| MINOR | boolean: on or off | display of minor tick marks on all axes |
MINOR= on
MINOR= off |
| NEUTRALCOLOR | color: middle color used with 3-color ramp | contours, gradient legends | NEUTRALCOLOR= orange |
| OUTPUTHEIGHT | dimension or % | height of graph |
OUTPUTHEIGHT= 300px
OUTPUTHEIGHT=4% |
| OUTPUTWIDTH | dimension or % | width of graph | OUTPUTWIDTH= 400px |
| STARTCOLOR | color: initial color used with 3-color ramp | contours, gradient legends | STARTCOLOR= yellow |
| THRESHOLD | % | axis tick labeling | THRESHOLD= 30% |
| TICKDISPLAY |
INSIDE
OUTSIDE
ACROSS |
all axis tick marks, major and minor | TICKDISPLAY=inside |
| TRANSPARENCY |
number:
0.0= opaque
1.0= transparent |
graphic background areas | TRANSPARENCY= 0.2 |