Sample 56523: Create graphics output for the web using PROC SGPLOT that has data tip functionality
The sample code on the Full Code tab demonstrates how to use the SGPLOT procedure to create graphics output for the web that has customized data tip functionality. When displaying the graph output via the web, position your mouse pointer over a specific bubble in the graph to display the values for horsepower, the city MPG rating, and the number of cylinders.
To create graph output with PROC SGPLOT that displays data tips, you need to use the procedure with the ODS HTML statement. Be sure to specify the IMAGEMAP=ON option in an ODS GRAPHICS statement. Also use the TIP= option as part of your SGPLOT syntax to list the variable values that you want displayed in the data tips, and use the TIPLABEL= option to assign custom labels to the data tips.
You must use SAS® 9.4 in order to successfully run this sample code.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
The sample code below writes its output to C:\TEMP when run in the Windows operating environment. Modify the value for the PATH= option in the ODS HTML statement below if you want to write the output to a location other than C:\TEMP or if you are running on an operating system other than Windows.
ods _all_ close;
ods html path='c:\temp' (url=none) file='s56523.html';
title1 h=12pt 'Generate Custom Data Tips with PROC SGPLOT';
ods graphics / imagemap=on;
proc sgplot data=sashelp.cars;
bubble x=horsepower y=mpg_city size=cylinders / tip=(horsepower mpg_city cylinders)
tiplabel=('HP' 'MPG' 'CYL');
run;
ods _all_ close;
ods preferences;
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
Date Modified: | 2015-09-14 15:09:40 |
Date Created: | 2015-08-28 16:03:39 |
Operating System and Release Information
SAS System | Base SAS | z/OS | 9.4 | | 9.4 TS1M0 | |
Z64 | 9.4 | | 9.4 TS1M0 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.4 | | 9.4 TS1M0 | |
Microsoft® Windows® for x64 | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows 8 Enterprise x64 | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows 8 Pro x64 | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows 8.1 Enterprise 32-bit | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows 8.1 Enterprise x64 | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows 8.1 Pro | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows 8.1 Pro 32-bit | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows Server 2008 R2 | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows Server 2008 for x64 | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows Server 2012 Datacenter | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows Server 2012 R2 Datacenter | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows Server 2012 R2 Std | 9.4 | | 9.4 TS1M0 | |
Microsoft Windows Server 2012 Std | 9.4 | | 9.4 TS1M0 | |
Windows 7 Enterprise x64 | 9.4 | | 9.4 TS1M0 | |
Windows 7 Professional x64 | 9.4 | | 9.4 TS1M0 | |
64-bit Enabled AIX | 9.4 | | 9.4 TS1M0 | |
64-bit Enabled HP-UX | 9.4 | | 9.4 TS1M0 | |
64-bit Enabled Solaris | 9.4 | | 9.4 TS1M0 | |
HP-UX IPF | 9.4 | | 9.4 TS1M0 | |
Linux for x64 | 9.4 | | 9.4 TS1M0 | |
Solaris for x64 | 9.4 | | 9.4 TS1M0 | |