Sample 49569: Define custom tooltips for your Graph Template Language (GTL) output
You might want to display custom tooltips on your graph so that information about the data is displayed when the cursor is positioned over a data location on the graph. The sample code on the
Full Code tab uses the ROLENAME= and TIP= options in the SCATTERPLOT statement to modify the default tooltips that are displayed. The
ROLENAME= option assigns the variables Name and Sex as the tooltips to display. The TIP= option specifies the order in which the tooltips are displayed. In order to display the tooltips, it is also necessary to specify the
IMAGEMAP= option in an ODS GRAPHICS statement. If this option is not specified, the tooltips are not generated or
displayed.
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.
You might want to display custom tooltips on your graph so that information about the data is displayed when the cursor is positioned over a data location on the graph. The sample code below uses the ROLENAME= and TIP= options in the SCATTERPLOT statement to modify the default tooltips that are displayed. The ROLENAME= option assigns the variables Name and Sex as the tooltips to display. The TIP= option specifies the order in which the tooltips are displayed. In order to display the tooltips, it is also necessary to specify the IMAGEMAP= option in an ODS GRAPHICS statement. If this option is not specified, the tooltips are not generated or displayed.
proc template;
define statgraph sgplot;
begingraph;
entrytitle 'Customizing Tooltips with GTL';
layout overlay;
scatterplot x=age y=height / primary=true
rolename=(tip1=name tip2=sex)
tip=(tip1 tip2);
endlayout;
endgraph;
end;
run;
ods graphics / imagemap;
proc sgrender data=sashelp.class template=sgplot;
run;
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.
This sample illustrates how to define custom tooltips for graphs generated with the Graph Template Language (GTL).
Type: | Sample |
Topic: | SAS Reference ==> Procedures ==> SGRENDER
|
Date Modified: | 2013-04-30 14:56:43 |
Date Created: | 2013-04-02 17:04:07 |
Operating System and Release Information
SAS System | SAS/GRAPH | 64-bit Enabled Solaris | 9.2 TS2M0 | |
64-bit Enabled HP-UX | 9.2 TS2M0 | |
64-bit Enabled AIX | 9.2 TS2M0 | |
Windows Vista for x64 | 9.2 TS2M0 | |
Windows Vista | 9.2 TS2M0 | |
Microsoft Windows XP Professional | 9.2 TS2M0 | |
Microsoft Windows Server 2008 for x64 | 9.2 TS2M0 | |
Microsoft Windows Server 2003 for x64 | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Standard Edition | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.2 TS2M0 | |
Microsoft® Windows® for x64 | 9.2 TS2M0 | |
Microsoft Windows XP 64-bit Edition | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.2 TS2M0 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.2 TS2M0 | |
z/OS | 9.2 TS2M0 | |
HP-UX IPF | 9.2 TS2M0 | |
Linux | 9.2 TS2M0 | |
Linux for x64 | 9.2 TS2M0 | |
OpenVMS on HP Integrity | 9.2 TS2M0 | |
Solaris for x64 | 9.2 TS2M0 | |