Graph Applet HTML Generator

Generating a Graph Applet HTML File

The Graph Applet HTML Generator creates an HTML file that contains an <APPLET> tag that invokes Graph Applet and all of the necessary parameters to enable Graph Applet to render your graphics in a Web browser.

Like the other HTML Formatting Tools, the Graph Applet HTML Generator is a macro that includes arguments that specify the formatting characteristics of your HTML page as well as arguments that specify information about and actions on your SAS data. The generator includes arguments that

The generator also supports advanced formatting controls, such as:

Note: For SAS 9.2 or later, the DS2GRAF macro is no longer supported. The documentation on this Web site is for Version 9.0 or earlier of SAS. Please migrate your applications to use the GPLOT/GCHART procedures with ODS and the Java or ActiveX device driver.


Enabling Drill Down

Graph Applet includes a URL-based drill mechanism that enables users to drill from the graphic to more detailed information. The information displayed when you drill on the graphic can be anything that you can include in an HTML file. For example, you might display another Graph Applet graphic, an HTML-formatted report, or a table of values formatted using the Data Set Formatter. If the URL is invalid or the HTML page referenced by the URL is not available, the user receives an error message in the browser.

For drill down to work, you must turn drilling on (using the DRILDOWN argument) and specify the information that enables Graph Applet to construct a valid URL (using the DRILURL argument).

For an example that includes these arguments, see the drill-down example.

Constructing a Drill URL

The syntax for the drill URL consists of a Web server name and special tags that identify variables and groups of variables:

  DRILURL=http://your-server-name/%nrstr({&tag[,f]}{&tag[,f]}{...}).html
The following table lists all of the valid values for tag.
Valid Drill-Down Tags
Tag Name Substitution Definition Supported With
G_COLOR The name of the current color variable. Scatter plot only
G_COLORV The value of the current color variable for the selected graph element. Scatter plot only
G_DEP The name of the current dependent variable. All graphs
G_DEPV The value of the current dependent variable for the selected graph element. All graphs
G_GROUP The name of the current group variable. Bar chart only
G_GROUPV The value of the current group variable for the selected graph element. Bar chart only
G_INDEP The name of the current independent variable. All graphs
G_INDEPV The value of the current independent variable for the selected graph element. All graphs
G_SUBGR The name of the current subgroup variable. Bar chart only
G_SUBGRV The value of the current subgroup variable for the selected graph element. Bar chart only
name The value of an explicit variable name for the selected graph element. All graphs

Each tag also accepts an optional parameter (f) that instructs the substitution to use formatted values. By default, it uses unformatted values.

Creating Custom Functions

Graph Applet performs most of the graphing functions that you need to Web-enable your SAS graphics. However, it is difficult to create functions that fill the needs of all Graph Applet users. For this reason, you can create a custom drill or save state function. If you choose to write your own JavaScript to handle drill and state, you must include the drilfunc and savefunc arguments, respectively.

Note: When you create custom functions, you are responsible for getting the function into your HTML page.