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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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