quit;
proc template;
define style spring;
parent = Styles.meadow;
style body from body;
style GraphColors from GraphColors /
"gborderlines" = cx000000
"greferencelines" = cx000000
"gaxis" = cx000000
"gwalls" = cxFF9999
;
style GraphBackground from GraphBackground "Graph background attributes" /
Color = cxFFFF99
;
end;
quit;
proc template;
define style summer;
parent = Styles.meadow;
style body from body;
style GraphColors from GraphColors /
"gborderlines" = cx000000
"greferencelines" = cx000000
"gaxis" = cx000000
"gwalls" = cx669933
;
style GraphBackground from GraphBackground "Graph background attributes" /
Color = cxE5D4A1
;
end;
quit;
proc template;
define style fall;
parent = Styles.meadow;
style body from body;
style GraphColors from GraphColors /
"gborderlines" = cx000000
"greferencelines" = cx000000
"gaxis" = cx000000
"gwalls" = cx996633
;
style GraphBackground from GraphBackground "Graph background attributes" /
Color = cxD9A465
;
end;
quit;
348 Chapter 15 Printing with SAS
ODS LISTING CLOSE;
Set the options to create an animated file for an SVG document. Set the
PRINTERPATH= option to create an SVG document. The ANIMATION= option starts
creating the animation. Each page in the animation is held in view for 3 seconds as
specified in the ANIMDURATION option. The SVGFADEIN=0 and SVGFADEOUT=0
options specify that the pages do not fade in or out of view. The NOANIMOVERLAY
option specifies that the pages are played sequentially. The ODS PRINTER CLOSE
statement closes any files that are open for the PRINTER destination. Because the
ANIMLOOP= option is not specified, the default of YES is used and the animations
loop continuously.
goptions reset=all;
options printerpath=svg animate=start animduration=3 svgfadein=0 svgfadeout=0
noanimoverlay nodate nonumber;
ODS PRINTER CLOSE;
Create an SVG document for each quarter, using the SGPLOT procedure. The
%LET macro variable is used to name the SVG file. The first ODS PRINTER statement
opens the PRINTER destination and creates the SVG file. After the first ODS PRINTER
statement, an ODS PRINTER statement is used before each procedure to specify the
style that indicates the seasonal colors to use to create a chart. The TITLE statement
specifies the season and the year that is reported. Each SGPLOT procedure plots the
sales for each country by using identical VBAR and YAXIS options in each procedure.
The vbar country / response=actual group=product; statement specifies
to create a vertical bar for each country. Each vertical bar contains sales data for each
product. The visual aspects for each product in vertical bar are automatically determined
by the SGPLOT procedure. The YAXIS statement specifies the values to plot for the Y
axis.
%let name=seasons;
ODS PRINTER file="&name..svg";
ods printer style=winter;
title1 h=18pt "Winter 1993 Sales";
proc sgplot data=work.q1y93 uniform=all;
vbar country / response=actual group=product;
yaxis values=(0 to 40000 by 10000);
run;
ods printer style=spring;
title1 h=18pt "Spring 1993 Sales";
proc sgplot data=work.q2y93 uniform=all;
vbar country / response=actual group=product;
yaxis values=(0 to 40000 by 10000);
run;
ods printer style=summer;
title1 h=18pt "Summer 1993 Sales";
proc sgplot data=work.q3y93 uniform=all;
vbar country / response=actual group=product;
yaxis values=(0 to 40000 by 10000);
run;
ods printer style=fall;
Creating Animated GIF Images and SVG Documents 349
title1 h=18pt "Fall 1993 Sales";
proc sgplot data=work.q4y93 uniform=all;
vbar country / response=actual group=product ;
yaxis values=(0 to 40000 by 10000);
run;
ods printer style=winter;
title1 h=18pt "Winter 1994 Sales";
proc sgplot data=work.q1y94 uniform=all;
vbar country / response=actual group=product ;
yaxis values=(0 to 40000 by 10000);
run;
ods printer style=spring;
title1 h=18pt "Spring 1994 Sales";
proc sgplot data=work.q2y94 uniform=all;
vbar country / response=actual group=product ;
yaxis values=(0 to 40000 by 10000);
run;
ods printer style=summer;
title1 h=18pt "Summer 1994 Sales";
proc sgplot data=work.q3y94 uniform=all;
vbar country / response=actual group=product ;
yaxis values=(0 to 40000 by 10000);
run;
ods printer style=fall;
title1 h=18pt "Fall 1994 Sales";
proc sgplot data=work.q4y94 uniform=all;
vbar country / response=actual group=product ;
yaxis values=(0 to 40000 by 10000);
run;
options animation=stop;
ods printer close;
Here are the charts that were created for 1993 by season:
350 Chapter 15 Printing with SAS
Creating Animated GIF Images and SVG Documents 351
352 Chapter 15 Printing with SAS
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.233.43