Note: This example addressing drill down using the DS2GRAF macro and Graph Applet. Use the drill capabilities provided with SAS/GRAPH software to accomplish drill down using SAS/GRAPH ActiveX Control.
This example uses the Graph Applet HTML Generator to create an HTML file that displays a bar chart using Graph Applet. However, You can use some of this code to create a drillable graph for the SAS/GRAPH ActiveX Control. Remember to check the syntax documentation for differences when creating for Graph Applet versus creating for the ActiveX control.
This example does not create the pages that are displayed when you click on a
bar in the chart. You can create these pages using any SAS Web tool
(such as ODS or an HTML Formatting Tool), or you can create them using your
favorite HTML editor. Just remember to name your files using the names
generated from the DRILURL
information you specified.
The SAS program used in this example contains three sections:
data test; length symbol $4 price 8.; input @1 symbol price; label symbol = 'Symbol' price = 'Unit Price'; cards; AMD 23.50 BORL 9.31 CA 47.25 CPQ 32.06 DELL 139.88 GTW 44.00 HWP 67.00 IBM 104.44 INTC 89.69 MSFT 84.75 ORCL 24.63 SUNW 47.63 ; run; |
title 'Graph Applet Sample'; |
%ds2graf(htmlfile=drill_test.html, data=test, name=Graph, graphtyp=bar, archive=http://web_server_name/sasweb/graph/graphapp.jar, indepvar=symbol, depvar=price, drildown=y, drilurl=http://web_server_name/%nrstr({&g_indepv}).html, ttag=header 2, tcolor=purple, center=y); |
Notice that the macro invocation includes the DRILDOWN
and
DRILURL
arguments. Both of these arguments are required to
enable the drill capabilities of Graph Applet. The DRILURL
argument dynamically builds the drill URL based on the information you
specify.
In this example, we have defined the URL for the drill pages to be
the root directory of our Web server (specified by
web_server_name
), and the filename to be determined
by the value of our independent variable, which we defined as 'symbol.'
So, if you click on the bar that represents the unit price for Gateway,
your browser requests a page named GTW.html from the Web server.
You can run this example at your site by copying the code above and
pasting it into a SAS program editor. If you want to try this, you
will need to specify a valid location for HTMLFILE
and
for ARCHIVE
. You must also specify a valid Web
server name in the DRILURL
value.
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.