Hi all,
I'd like to use ods layout absolute to place a chart (created with proc sgrender) over a map (created with proc gmap) in a pdf. How can I set the background of the chart to be transparent so that the map is visible at the sides of the chart? "Goptions transparency" does not seem to help here. I use the code below on SAS 9.4M2 on Windows.
Thanks for your help!
Jonas
options orientation=landscape leftmargin=0.01cm rightmargin=0.01cm bottommargin=0.01cm topmargin=0.01cm papersize='A4';
options nodate nonumber nocenter;
goptions reset=all noborder device=ACTXIMG transparency;
ods escapechar="~";
ods graphics on /noborder;
title; footnote;
ods pdf
notoc
nogtitle
nogfootnote
dpi=300
title="Test transparent Background with ods"
author="Jonas"
file="c:\FancyMap.pdf";
ods layout absolute;
proc gmap map=maps.europe(where=(id ne 405 and id ne 845))
data=sashelp.demographics(where=(cont=93)) all;
id id;
choro pop / cdefault=yellow;
run;
quit;
ods region x=7cm y=5cm width=7cm height=7cm;
proc template;
define statgraph piechart;
begingraph;
entrytitle "Creating a Pie Chart of Automobile Makes";
layout region;
piechart category=make / datalabellocation=inside dataskin=sheen
categorydirection=clockwise start=180
othersliceopts=(type=percent percent=5 label="Other Makes");
endlayout;
endgraph;
end;
/* Define the style for the colors of the pie slices and the outline */
define style mystyle;
parent=styles.watercolor;
style graphoutlines from graphoutlines / contrastcolor=gray55;
end;
run;
ods listing style=mystyle;
proc sgrender data=sashelp.cars template=piechart;
where origin='Asia';
run;
ods layout end;
ods pdf close;
Transparent backgrounds are supported with SAS 9.40M3 GTL. Add these options to the BEGINGRAPH statement.
BEGINGRAPH / OPAQUE=false PAD=0;
Transparent backgrounds are supported with SAS 9.40M3 GTL. Add these options to the BEGINGRAPH statement.
BEGINGRAPH / OPAQUE=false PAD=0;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.