Usage Note 23199: Can I use an imagemap to add tool tips to GIF or JPEG graphics that are produced by SAS/GRAPH software?
In SAS 8, SAS/GRAPH software can create an imagemap for a GIF or JPEG graphic that will display information about a particular section of the graph when you move the mouse pointer over that section. This functionality is available by including the ALT= and onMouseOver= tags in the value for the HTML= variable.
The ALT= tag generates the information in hover text that appears when you move the mouse pointer near the item. The onMouseOver= tag displays the information in the status bar of the browser window. This status bar is usually located at the bottom of the browser window. Most browsers support at least one of these tags. However, some browsers might not support either one. These parameters will not work with output that is generated by the ActiveX or Java device drivers.
See the following example for a demonstration.
|
/***************************************************************************/
/* */
/* ADDING 'TOOLTIPS' TO GIF AND JPEG GRAPHICS USING AN IMAGEMAP */
/* */
/* This is a modification of the example */
/* "Using ODS to generate a drill-down graph for the Web" */
/* Available at: */
/* http://support.sas.com/rnd/samples/graph/gifdriver/gifonmouseover.html */
/* */
/* The value of the HTML= variable, RPT, has been changed in the REGSALES */
/* data set to include the ALT= and onMouseOver= tags. The ALT= value will */
/* appear as a tool tip above the bar when you move the mouse pointer over */
/* it. The onMouseOver= tag includes JavaScript code to place the text */
/* in the status bar of the browser window when your mouse pointer is over */
/* the bar. */
/* */
/***************************************************************************/
/* This is the only line you have to change to run the program. */
/* Specify a location for the output in your file system. */
filename odsout '';
/* Close the listing destination. */
ods listing close;
/* Set general graphics options. */
goptions reset=all gunit=pct htitle=6 htext=4 ftitle=zapfb ftext=swiss;
/* Create the data set REGSALES. */
data regsales;
length Region State $ 8 rpt $300;
format Sales dollar8.;
input Region State Sales;
/* The HTML variable. Set the length large enough to contain the */
/* necessary tags and desired text. */
length rpt $300.;
/* Assign values to the TEXT variable by REGION. In this case, the text */
/* will be the names of the different states within the region. */
if Region = 'Central' then text="'Illinois, Indiana, Ohio, Michigan'";
else if Region = 'South' then text ="'Florida, Georgia'";
else if Region = 'West' then text="'California, Oregon, Washington'";
/* Create the RPT variable for each REGION. The ALT= tag contains only */
/* the value of the TEXT variable. The onMouseOver= tag uses JavaScript */
/* to place the text on the status line of the browser. */
rpt='href="'||trim(region)||'.htm" alt='||trim(text)||
' onMouseOver="self.status='||trim(text)||';return true;"';
/* Data for the graph */
cards;
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
;
run;
/* Assign graphics options for ODS output. */
goptions device=gif transparency noborder xpixels=450 ypixels=400;
/*** Create the drill-down pages of the output. ***/
/* Open a body file for report on Central sales. */
ods html body = 'central.htm' path = odsout;
title1 'Central Sales';
proc print data=regsales noobs;
var state sales;
where region='Central';
run;
/* Open a body file for report on Southern sales. */
ods html body = 'south.htm' path = odsout;
title1 'Southern Sales';
proc print data=regsales noobs;
var state sales;
where region='South';
run;
/* Open a body file for report on Western sales. */
ods html body = 'west.htm' path = odsout;
title1 'Western Sales';
proc print data=regsales noobs;
var state sales;
where region='West';
run;
quit;
/* Open the HTML destination for ODS output. */
ods html body = 'sales.htm' path = odsout;
/*** Create the main page of the output. ***/
/* This page includes the HTML variable. */
title1 'Company Sales';
proc gchart data=regsales;
vbar3d region / sumvar = sales patternid = midpoint html = rpt;
run;
quit;
/* Close the HTML destination. */
ods html close;
/* Open the listing destination. */
ods listing;
goptions reset=all;
filename odsout clear;
|
Operating System and Release Information
SAS System | SAS/GRAPH | All | n/a | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
Type: | Usage Note |
Priority: | low |
Topic: | SAS Reference ==> Procedures ==> GCHART
|
Date Modified: | 2008-01-14 15:05:40 |
Date Created: | 2003-02-25 14:48:22 |