![]() Chapter Contents |
![]() Previous |
![]() Next |
| SAS/GRAPH Software: Reference |
This example shows how to use a SAS/GRAPH Web driver to generate a drill-down graph (see About Drill-down Graphs). The example uses the HTML driver, but the principals would be the same for using the WEBFRAME driver.
| Planning the Web Page |
To create this drill-down graph, you need the following:
| Output Needed for the Drill-down Graph |
To generate this example drill-down bar chart, you must run the GCHART procedure with the VBAR3D statement. The PROC GCHART statement must use the IMAGEMAP= option to create an Imagemap data set, and the VBAR3D statement must use the HTML= option to specify the HTML variable that contains the linking information, in this case the variable LINKS. To generate the pie charts, you can use PROC GCHART to generate all three pie charts in a single procedure run by using BY-group processing (see BY Statement) .
| Code for the Example |
/* This is the only line you have to change to run the */
/* program. Specify a location in your file system. */
filename webout 'path-to-Web-server';
/* set general graphic options */
goptions reset=global gunit=pct
htitle=6 htext=4
ftitle=zapfb ftext=swiss border;
/* assign graphics options for ods output */
goptions transparency noborder
xpixels=450 ypixels=400
gsfname=webout device=html;
/* create data set REGSALES */
data regsales;
length Region State $ 8;
format Sales dollar8.;
input Region State Sales;
length links $40; /* the HTML variable */
/* add the HTML variable and assign its values */
if Region='Central' then links='href="salereg1.gif"';
else if Region='South' then links='href="salereg2.gif"';
else if Region='West' then links='href="salereg3.gif"';
datalines;
West CA 13636
West OR 18988
West WA 14523
Central IL 18038
Central IN 13611
Central OH 11084
Central MI 19660
South FL 14541
South GA 19022
;
title1 'Company Sales';
proc gchart data=regsales imagemap=salemap;
vbar3d region / sumvar=sales
patternid=midpoint
html=links name='htmldril';
run;
/* change to GIF driver for pie charts */
goptions dev=gif;
proc sort data=regsales out=regsales;
by region;
/* Create a chart that uses the HTML variable */
proc gchart data=regsales;
pie3d state / sumvar=sales
noheading name='salereg1';
by region;
run;
quit;
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.