Sample 49270: Create animated SVG output that overlays a pie chart, a bar chart, and a scatter plot on the same page
Beginning with SAS® 9.4, you can create animated graphs in scalable vector graphics (SVG) format. New options available in the OPTIONS statement enable you to have a wide range of control over the SVG animation. Note that in order to take advantage of SVG graphics, you must use an SVG-enabled web browser to view the graphics output.
The sample code on the Full Code tab uses two PROC GCHART steps and a PROC GPLOT step to overlay a pie chart, a bar chart, and a scatter plot on the same page.
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.
Support for animated SVG graphics output is new starting with SAS 9.4. You must be running SAS 9.4 in order to run this sample code.
data class;
set sashelp.class;
if name='Louise' then delete;
run;
/* Set the DEVICE to SVG */
goptions reset=all device=svg border;
/* Set the SVG animation options */
options animate=start animduration=3 svgfadein=2
svgautoplay animloop=1 animoverlay
svgheight="400px" svgwidth="600px"
nodate nonumber ;
ods _all_ close;
ods html5 file='svg_overlay.html' options(svg_mode='inline');
title1 'This is a sample using SVG with animation to overlay graphs on the page';
proc gslide border name='overlay';
run;
quit;
/* Use a transparent value for CBACK to allow each graph */
/* to show through when placed on top of each other. */
/* Use a blank TITLE statement to force the pie graph */
/* to move down on the page. */
goptions cback=AFFFFFF00 htext=8pt;
title1 h=16 ' ';
proc gchart data=class;
pie3d name/sumvar=weight noheading;
run;
quit;
/* Specify HSIZE, VSIZE, HORIGIN and VORIGIN options to */
/* place the next two graphs on top of the first graph. */
goptions hsize=3 vsize=3 horigin=0 vorigin=3
cback=AFFFFFF00 htext=10pt noborder;
title1;
axis1 minor=none;
proc gchart data=class;
vbar sex / patternid=midpoint raxis=axis1 width=10 space=4;
run;
quit;
goptions hsize=3 vsize=3 horigin=5 vorigin=3 cback=AFFFFFF00;
symbol1 i=none v=dot c=libg h=2;
proc gplot data=class;
plot height*weight / haxis=axis1 vaxis=axis1;
run;
quit;
ods _all_ close;
ods listing;
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 reate animated SVG output that overlays a pie chart, a bar chart, and a scatter plot on the same page.
Date Modified: | 2013-07-02 08:59:22 |
Date Created: | 2013-02-25 11:08:24 |
Operating System and Release Information
SAS System | SAS/GRAPH | z/OS | 9.4 TS1M0 | |
Microsoft® Windows® for x64 | 9.4 TS1M0 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.4 TS1M0 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.4 TS1M0 | |
Microsoft Windows Server 2003 Standard Edition | 9.4 TS1M0 | |
Microsoft Windows Server 2003 for x64 | 9.4 TS1M0 | |
Microsoft Windows Server 2008 | 9.4 TS1M0 | |
Microsoft Windows Server 2008 for x64 | 9.4 TS1M0 | |
Microsoft Windows XP Professional | 9.4 TS1M0 | |
Windows 7 Enterprise 32 bit | 9.4 TS1M0 | |
Windows 7 Enterprise x64 | 9.4 TS1M0 | |
Windows 7 Home Premium 32 bit | 9.4 TS1M0 | |
Windows 7 Home Premium x64 | 9.4 TS1M0 | |
Windows 7 Professional 32 bit | 9.4 TS1M0 | |
Windows 7 Professional x64 | 9.4 TS1M0 | |
Windows 7 Ultimate 32 bit | 9.4 TS1M0 | |
Windows 7 Ultimate x64 | 9.4 TS1M0 | |
Windows Vista | 9.4 TS1M0 | |
Windows Vista for x64 | 9.4 TS1M0 | |
64-bit Enabled AIX | 9.4 TS1M0 | |
64-bit Enabled Solaris | 9.4 TS1M0 | |
HP-UX IPF | 9.4 TS1M0 | |
Linux for x64 | 9.4 TS1M0 | |
Solaris for x64 | 9.4 TS1M0 | |