highlow x=date high=high low=low
/ close=close;
run;
title;
ods printer close;
ods html;
For information about the NEWFILE= option, see “ODS PRINTER Statement ” in SAS
Output Delivery System: Users Guide.
Creating Overlaid Transparent SVG Documents
You use the SVTt Universal Printer to create a transparent SVG document in which the
pages are transparent and can be overlaid. The following is a SAS program that overlays
a bar chart on a map of the United States:
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"
334 Chapter 15 Printing with SAS
iback='c:publicmySASPrograms ipple.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';
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;
This code creates the following SVG:
Creating SVG (Scalable Vector Graphics) Files Using Universal Printing 335
Figure 15.40 A Bar Chart Overlaying a SAS/GRAPH Map
See “Enhancing Drill-Down Behavior in SVG Presentations Using HTML Attributes” in
SAS/GRAPH: Reference for an example of using overlaid images for drill-down links in
graphs.
SVG Documents in HTML Files
Overview of SVG Documents in HTML Files
To view an SVG document in an HTML file, you either create a link to the SVG
document, embed the SVG document in the HTML file, or create an SVG graph that is
integrated in the HTML file.
You can embed an SVG document in an HTML file using these methods:
Create an SVG graph using ODS GRAPHICS and the ODS HTML5 statement with
the option SVG_MODE="EMBED".
Use SAS/GRAPH and run your SAS program using the ODS HTML DEV=SVG
statement. SAS creates the SVG document and the HTML file, embedding the SVG
document in the HTML file using the <EMBED> element.
Create an SVG document using the ODS PRINTER statement and the
PRINTERPATH=SVG option. Then, embed the SVG document in an HTML file
using the <EMBED> element.
336 Chapter 15 Printing with SAS
You can integrate an SVG graph in an HTML file by using the ODS HTML5
SVG_MODE='INLINE' statement.
For information about creating SVG document in SAS/GRAPH, see “Generating SVG,
PNG, GIF, and TIFF Graphics ” in SAS/GRAPH: Reference.
Linking to an SVG Document
If you link to an SVG document in an HTML document and you are using the default
values for the SVG system options, the SVG document opens in the browser window
and scales to the size of the viewable area in the window. For an example of an HTML
file that links to an SVG document, see Figure 15.41 on page 338 and Figure 15.42 on
page 339.
Embedding SVG Documents in HTML Files
When you embed SVG documents in an HTML file, the height and width attributes of
the <EMBED> tag become the dimensions of the viewport. If you use the default values
for the SVG system options when you create your SVG document, the SVG document
scales to the size of the viewport. This is because there is no default value of the
SVGHEIGHT= and SVGWIDTH= system options, which effectively equates to
specifying a value of 100%. A value of 100% for these system options scales the SVG
document to 100% of the viewport.
If you do not specify height and width attributes on the embed tag, the viewport
dimensions are determined by the browser. The embedded document might not render as
you expected it to render.
The following HTML file demonstrates linking and embedding a stand-alone SVG
document in an HTML file:
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>
<html>
<head>
<title>Linking and Embedding an SVG Document in an HTML Document</title>
<meta http-equiv="X-UA-Compatible" content="IE=9".
</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>
Here is the HTML file:
Creating SVG (Scalable Vector Graphics) Files Using Universal Printing 337
Figure 15.41 An HTML Document Displaying a Link to a Stand-alone SVG Document and an
Embedded SVG Document
The viewport has a height of 400 pixels and a width of 300 pixels. Because the default
SVG system option values were used, the SVG document scales to 100% of the
viewport.
If you click the SGPLOT Graph link, the browser displays the following SVG
document:
338 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
3.21.248.162