Controlling Titles and Footnotes

When you use ODS to send your graphs to an HTML, RTF, or PRINTER destination, you can control the location where titles and footnotes are printed or displayed. They can be displayed by ODS as part of the output file (such as the HTML body file) just as they are with tabular output, or they can be rendered as part of the graphical image. Whether titles and footnotes are rendered as part of the image determines how you control their font, size, and color.

Controlling Where Titles and Footnotes Are Rendered

Where titles and footnotes are displayed 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 created by ODS as part of the HTML or RTF file. The GTITLE and GFOOTNOTE options are ignored for these drivers. (These devices are not supported for the PRINTER destination.)
For all other devices, the GTITLE and GFOOTNOTE options determine where the titles and footnotes are displayed. The default settings, GTITLE and GFOOTNOTE, render titles and footnotes as part of the graphic image. If you want titles and footnotes to appear as part of the output file (for example, 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 ODS output file */
ods html body="filename.htm" nogtitle nogfootnote;
Specifying NOGTITLE or NOGFOOTNOTE can increase the amount of space allowed for the procedure output area, which can increase the size of the graph, but the aspect ratio is preserved. 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.
Note: When you specify NOGTITLE or NOGFOOTNOTE, the title or footnote text is not part of the GSEG and cannot be retrieved when the graph is replayed.

Using Graphics Options with ODS (USEGOPT)

When titles and footnotes are rendered as part of ODS output 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:
  • CTEXT=
  • CTITLE=
  • FTEXT=
  • FTITLE=
  • HTEXT=
  • HTITLE=
When titles and footnotes are rendered as part of the graphic image, these options are honored regardless of whether you specify the ODS USEGOPTS 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.

Controlling the Text Font, Size, and Color

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. If titles and footnotes are rendered as part of the ODS output file, and if you have specified the ODS USEGOPTS statement, then SAS looks for global options such as CTEXT= and FTITLE= in the GOPTIONS statement. When titles and footnotes are rendered as part of the graphic image, SAS looks for options on the GOPTIONS statement regardless of the setting of whether you specify the ODS USEGOPTS 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 ODS output 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 graphic file, 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 the following topics: