BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jb3
Obsidian | Level 7 jb3
Obsidian | Level 7

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;

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Jay54
Meteorite | Level 14

Transparent backgrounds are supported with SAS 9.40M3 GTL.  Add these options to the BEGINGRAPH statement.

  BEGINGRAPH / OPAQUE=false PAD=0;

View solution in original post

1 REPLY 1
Jay54
Meteorite | Level 14

Transparent backgrounds are supported with SAS 9.40M3 GTL.  Add these options to the BEGINGRAPH statement.

  BEGINGRAPH / OPAQUE=false PAD=0;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 3349 views
  • 1 like
  • 2 in conversation