SVG 1
|
|
produces SVG 1.1 animated
documents. Animation timing is static if you use this printer and
do not have
|
|
SVGt 1
|
|
SVGZ 1
|
|
SVGView 1
|
|
1When you use this printer
in |
options printerpath=svg;
ods html close;
ods printer;
...more SAS code...
ods printer close;
ods html;
Alternatively, you can specify the SVG printer in the ODS PRINTER
statement and eliminate the OPTIONS statement, as shown below.ods html close;
ods printer printer=svg;
...more SAS code...
ods printer close;
ods html;
Adobe SVG Viewer 3 1
|
|
1Adobe SVG Viewer 3 works in Internet Explorer 7 and Internet Explorer 8. It is no longer supported by Adobe Systems Inc. |
<image>
element has an xlink
attribute that begins as follows:xlink:href="data:image/png;base64,The base64 encoded image follows after
base64,
.
iVBORwOK
and
extends to the right on the same line. It cannot be shown in this document.
proc template; define style logo; parent = Styles.default; style Body from Body / backgroundimage = 'c:\saslogo.gif'; end; run; ods html close; options nodate nonumber orientation=landscape obs=5; ods printer style=logo printer=svgview file='logo.svg'; proc print data=sashelp.class; title 'Five Observations of sashelp.class'; run; ods printer close; ods html;
<image id="Image3" width="200" height="150" xlink:href="I3svgimg.png"> </image>
options printerpath=svgz;
<svg>
element
is a set of four numbers: the starting X coordinate, the starting
Y coordinate, the height of the SVG document, and the width of the
SVG document. SAS sets the viewBox attribute value from the value
of the SVGVIEWBOX= system option. If that option has no value, SAS
uses the value of the PAPERSIZE= system option to set the height and
the width arguments of the viewBox attribute. The starting coordinate
values are set to 0.
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http:://www.w3.org/1999/xlink" xml:space="preserve" onload='Init(evt)' version="1.1" baseProfile="full" viewBox="-1 -1 801 601">
options nodate printerpath=svg papersize=("8cm" "5cm") svgwidth="8cm" svgheight="5cm" svgtitle="SASHELP.CLASS Plotted by The SGPLOT Procedure";
xMidYMid
value to align the midpoint
X value of the viewBox to the midpoint X value of the viewport, which
centers the document horizontally.
meet
or slice
. If
you specify meet
, the SVG document
is scaled up as much as possible while meeting other criteria. The
viewport displays some unused space. If you specify slice
, the SVG document is scaled down as much as
possible while meeting other criteria. In the latter case, some of
the SVG document appears to be cut off. The SVG document is still
complete, but you cannot see all of it in the viewport. You can use
your browser controls to move the SVG document around in the viewport.
options printerpath=svg; ods html close; ods printer; proc sgplot data=sashelp.class; reg x=height y=weight / CLM CLI; run; ods printer close; ods html;
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" onload='Init(evt)' version="1.1" baseProfile="full" viewBox="-1 -1 801 601">
options nodate printerpath=(svgview stocks) papersize=("6" "6") ; filename stocks 'c:\mySas\output\stocks.svg'; ods html close; ods printer; proc sgplot data=sashelp.stocks (where=(date >= "01jan2000"d and date <= "01jan2001"d and stock = "IBM")); title "Stock Volume vs. Close"; vbar date / response=volume; vline date / response=close y2axis; run; title; proc sgplot data=sashelp.stocks (where=(date >= "01jan2000"d and stock = "IBM")); title "Stock Trend"; series x=date y=close; series x=date y=low; series x=date y=high; run; title; title "Stock High, Low, and Close"; proc sgplot data=sashelp.stocks; where Date >= '01JAN2005'd and stock='IBM'; highlow x=date high=high low=low / close=close; run; title; ods printer close; ods html;
options nodate printerpath=svgview papersize=("6" "6");
ods html close;
ods printer newfile=page;
proc sgplot data=sashelp.stocks (where=(date >= "01jan2000"d
and date <= "01jan2001"d
and stock = "IBM"));
title "Stock Volume vs. Close";
vbar date / response=volume;
vline date / response=close y2axis;
run;
title;
proc sgplot data=sashelp.stocks
(where=(date >= "01jan2000"d and stock = "IBM"));
title "Stock Trend";
series x=date y=close;
series x=date y=low;
series x=date y=high;
run;
title;
title "Stock High, Low, and Close";
proc sgplot data=sashelp.stocks;
where Date >= '01JAN2005'd and stock='IBM';
highlow x=date high=high low=low
/ close=close;
run;
title;
ods printer close;
ods html;
data boxanno; length function color style $20 text $16; retain xsys ysys '2' hsys '3' when 'a'; set maps.uscity(keep=x y city state); where city='Raleigh' and state=stfips('NC'); color='blue'; size=4; text='V'; position='5'; style='marker'; output; myx=x; myy=y; function='move'; x=myx; y=myy; output; function='draw'; x=myx-.432; y=myy+.0417; color='black'; line=1; size=.2; style='solid'; output; function='move'; x=myx; y=myy; output; function='draw'; x=myx-.432; y=myy+.178; output; function='move'; x=myx; y=myy; output; function='draw'; x=myx-.251; y=myy+.178; output; function='move'; x=myx; y=myy; output; function='draw'; x=myx-.251; y=myy+.0417; output; run; %let name=annomap; filename odsout '.'; goptions reset=all; /* Close the HTML and LISTING destinations for map creation. */ ods html close; ods listing close; options printerpath=svgt nodate nonumber; ods printer file='annomap.svg' ; goptions border; goptions gunit=pct htitle=3 htext=2 ftext="arial/bo" iback='c:\public\mySASPrograms\ripple.jpg'; pattern1 v=s c=cornsilk; title1 c=red "SAS/Graph gmap and Overlayed gchart with printerpath=svgt"; proc gmap data=maps.us map=maps.us ; id state; choro state / levels=1 nolegend coutline=blue anno=boxanno des="" name="&name"; run; quit; goptions iback= hsize=2.07 vsize=1.57 horigin=2.1 vorigin=3.12 autosize=on dev=svgt; /* you must use the default ods style, for transparency to work */ goptions gunit=pct htext=8 ftext="Albany AMT" ; title c=blue h=10 'Transparent SVG'; *pattern1 v=s c=red; axis1 label=none value=none major=none minor=none style=0; axis2 color=blue label=none offset=(7,7) value=(color=blue); proc gchart data=sashelp.class; vbar3d age / discrete patternid=midpoint descending raxis=axis1 maxis=axis2 width=9 space=5 frame cframe=rgba0195FF50 coutline=blue woutline=1 des="" name="&name.b"; run; quit; ods printer close;
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”> <html> <head> <title>Linking and Embedding an SVG Document in an HTML Document</title> </head> <body> <p>Linking to an SVG document:</p> <a href="sasprt.svg">SGPlot Graph</a> <p>Embed the SVG document:</p> <embed src="sasprt.svg" type="image/svg+xml" height="400" width="300"> </body> </html>