Previous Page | Next Page

Managing Your Graphics With ODS

Controlling Titles and Footnotes with Java and ActiveX Devices in HTML Output

When you use ODS to send your graphs to an HTML destination, you can choose whether titles and footnotes are rendered as part of the HTML body file, as they are with tabular output, or the graphical image that appears in the Web page.

Where titles and footnotes are rendered determines how you control their font, size, and color.


Controlling Where Titles and Footnotes are Rendered

Where titles and footnotes are rendered depends on the device driver that you are using and on the setting of the ODS statement options GTITLE and GFOOTNOTE.

For the JAVA, JAVAIMG, ACTIVEX, and ACTXIMG device drivers, titles and footnotes are always rendered as part of the HTML body file. The GTITLE and GFOOTNOTE options are ignored for these drivers.

For all other devices, the GTITLE and GFOOTNOTE options determine where the titles and footnotes are rendered. The default settings, GTITLE and GFOOTNOTE, render titles and footnotes as part of the graphic image. If you want titles and footnotes to appear within the HTML body file and not as part of the graphical image, you must specify the NOGTITLE or NOGFOOTNOTE option, as in the following example.

/* direct titles and footnotes to the HTML file */
ods html body="filename.htm" nogtitle nogfootnote;

If the title or footnote is being output through an ODS markup destination (such as HTML) and the corresponding ODS option NOGTITLE or NOGFOOTNOTE is specified, then the title or footnote is rendered in the body of the HTML file rather than in the graphic itself. Specifying NOGTITLE or NOGFOOTNOTE results in increasing the amount of space allowed for the procedure output area, which can result in increasing the size of the graph. Space that would have been used for the title or footnote is devoted instead to the graph. You might need to be aware of this possible difference if you are using annotate or map coordinates.


Controlling the Text Font, Size, and Color

When you use ODS to send graphics to an HTML destination, and titles and footnotes are rendered as part of the HTML body file instead of the graphic image, then SAS looks for information about how to format titles and footnotes in the following order:

  1. SAS looks for options on the TITLE and FOOTNOTE statement. For example, you can specify BOLD, ITALIC, FONT=, or HEIGHT= options on these statements.

  2. SAS looks for global options such as CTEXT= and FTITLE= in the GOPTIONS statement. For more information, see Using Graphics Options with ODS (USEGOPT).

  3. SAS looks for information specified in the current style.

When titles and footnotes are rendered as part of the graphic image, SAS looks first for options on the TITLE and FOOTNOTE statement and then for options in the GOPTIONS statement. When titles and footnotes are rendered as part of the graphic image, you do not need to specify the ODS USEGOPT statement.

When titles and footnotes are rendered as part of the body of the HTML file, font sizes that are specified as a percentage are interpreted as a percentage of the size specified by the current style. When titles and footnotes are rendered as part of the image, fonts sizes that are specified as a percentage are interpreted as a percentage of graphics output area. For more information about specifying fonts and font sizes, refer to


Using Graphics Options with ODS (USEGOPT)

When you use ODS to send graphics to an HTML destination, and titles and footnotes are rendered as part of the HTML body file instead of the graphic image, ODS does not recognize the settings for the following graphics options unless you also specify the ODS USEGOPT statement:

For example, the following code generates two graphs. The title for the first graph uses the text color and font as defined by the current style (ASTRONOMY). The title for the second graph uses the font size and color specified by the HTITLE and CTEXT options.
ods html file="myout.htm" style=astronomy; 
goptions reset=all dev=activex htitle=8 ctext="black";

ods nousegopt;
title "My title"; 
footnote "My footnote";
proc gchart data=sashelp.class;    
   pie age / discrete legend; 
run; 

ods usegopt;    
   pie age / discrete legend; 
run;  

quit; 
ods nousegopt; 
ods html close; 

While ODS USEGOPT is in effect, the settings for these graphics options affect all of the titles and footnotes rendered by ODS. To turn off the use of these graphics option settings for non-graphic output, specify the ODS NOUSEGOPT statement.

The default setting is ODS NOUSEGOPT.

Previous Page | Next Page | Top of Page