Controlling Titles and Footnotes with ODS 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 body file       */  filename odsout '  path-to-Web-server  ';  goptions device=gif;  ods html body='sales.html' path=odsout      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 on the GOPTIONS statement. For more information, see Using Graphics Options with ODS on page 493.

  3. SAS looks for information specified in the style being used. If you did not specify a style on the ODS statement, then SAS uses information specified in the default 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 on 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

  • FTEXT on page 294 and FTITLE on page 294

  • HTEXT on page 316 and HTITLE on page 317

  • GUNIT on page 309

  • TITLE, FOOTNOTE, and NOTE Statements on page 210.

Using Graphics Options with ODS

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 will not recognize the settings for the following graphics options unless you also specify the ODS USEGOPT statement:

  • CTEXT=

  • CTITLE=

  • FTEXT=

  • FTITLE=

  • ZHTEXT=

  • HTITLE=

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="C:\Public\myout1.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 sex / legend;  run;  quit;  ods nousegopt;  ods html close; 

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

The default setting is ODS NOUSEGOPT.




SAS.GRAPH 9.1 Reference, Volumes I and II
SAS.GRAPH 9.1 Reference, Volumes I and II
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 342

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net