Data visualization with SAS programming

How to set transparent background of ods chart

Accepted Solution Solved
Reply
Occasional Contributor jb3
Occasional Contributor
Posts: 15
Accepted Solution

How to set transparent background of ods chart

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;

 

 


Accepted Solutions
Solution
‎04-07-2016 10:59 AM
SAS Super FREQ
Posts: 1,145

Re: How to set transparent background of ods chart

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


All Replies
Solution
‎04-07-2016 10:59 AM
SAS Super FREQ
Posts: 1,145

Re: How to set transparent background of ods chart

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

  BEGINGRAPH / OPAQUE=false PAD=0;

☑ This topic is solved.

Need further help from the community? Please ask a new question.

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