BookmarkSubscribeRSS Feed
pmksasbi
Fluorite | Level 6

Hi All,

 

is there a way where i can remove the background  from white and make it transparent. I am using this options , but i want to make the background color to be transparent . is there any such options. Thanks

 

goptions reset=all border cback=white htitle=5.0 htext=4.0 imagestyle= vsize=5.17in hsize=7.10in;
goptions device=jpeg gsfname=out;
goptions xpixels=500 ypixels=500;
goptions cback=white;
goptions border
gunit=pct htitle=5.0 htext=4.0 ctext=gray33;

 

 

4 REPLIES 4
ArtC
Rhodochrosite | Level 12

Not an exact solution, but a potential starting point is this post:https://communities.sas.com/t5/SAS-GRAPH-and-ODS-Graphics/How-to-set-transparent-background-of-ods-c...

ballardw
Super User

If you are using a traditional device based graphic procedure such as Gplot, Gchart, Gslide or Gmap I don't believe you can set transparency.

 

If this is for an annotate data set my may be able to determine the color you are displaying on and set to that color. Maybe. Not with any gradient and wouldn't work with any background color other than a solid fill pattern (no crosshatch or line pattern ),

 

If you share some example data and the full code we may be able to suggest something using the ODS graphic procedures that do support transparency.

DanH_sas
SAS Super FREQ

Can you set your device to be PNG and use GOPTIONS TRANSPARENCY?

 

http://support.sas.com/documentation/cdl/en/graphref/69717/HTML/default/viewer.htm#p0z42ld4n1bs5jn19...

 

 

GraphGuy
Meteorite | Level 14

Dan is correct - I have verified it with the code below, and verified that the background looks 'checkerboard' in Photoshop, which indicates that it is transparent:

 

filename odsout '.';
ODS LISTING CLOSE;
ODS HTML path=odsout body="transparent.htm";

goptions device=png;
goptions transparency;
proc gchart data=sashelp.class;
hbar name / type=sum sumvar=height descending space=0
des='' name="transparent";
run;

quit;
ODS HTML CLOSE;
ODS LISTING;

 

transparent_photoshop.png

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1222 views
  • 0 likes
  • 5 in conversation