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

Hello!

 

I've very new to creating graphics in SAS, here is what I have:

smg3141_0-1638561077974.png

 

The main things I would like to do are:

1.) Move the headers to above the "Age at Death (years)" label, I was able to make it a footnote as a work around, but it wasn't centered with the panels.

2.) Change the color of the headers to white and remove the outline, I've tried adding HEADERBACKCOLOR=white and NOHEADERBOARDER to the panelby statement. HEADERBACKCOLOR=white throws a syntax error. NOHEADERBOARDER deleted the headers entirely. 

3.) Not as desired as the others, but I'd like a very small white space between each year instead of them being side by side. I've tried altering BARWIDTH= in the colaxis statement with no effect. 

 

I'm using SAS 9.4 TS level 1M2 with ODS Graphics on. 

 

Code:

proc sgpanel data=w.figure2sample2 noautolegend;
where deathcategory_4 = 'CVD';
title 'Number of Deaths by Category Aged 25 and Older by 10-Year Intervals, 1964-2019';
title2 'Cardio Vascular Disease' ;
panelby agegroup / layout=columnlattice onepanel novarname noborder colheaderpos=bottom headerattrs=(size=8pt);
vbar year / groupdisplay=cluster fillattrs=(color=grey) outlineattrs=(color=grey) ;
colaxis display=(NOTICKS) fitpolicy=none label='Age at Death (years)'
valueattrs=( size=6pt )
values=(1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980
1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999
2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019)
valuesdisplay=("" "" "" "" "" "" "1970" "" "" "" "" "" "" "" "" "" ""
"" "" "" "" "" "" "" "" "" "1990" "" "" "" "" "" "" "" "" ""
"" "" "" "" "" "" "" "" "" "" "2010" "" "" "" "" "" "" "" "" "");
rowaxis label='Number of Deaths';
run;

 

Any help is greatly appreciated!

1 ACCEPTED SOLUTION

Accepted Solutions
pink_poodle
Barite | Level 11

It could be easier to output a simple slide with just the graph and no border to PowerPoint and edit it there.
ods graphics/noborder;
options nodate nonumber;
ods powerpoint file ="C:\Users\User\Desktop\example.pptx" ;
***simplified sgpanel code***;
ods powerpoint close;

View solution in original post

3 REPLIES 3
pink_poodle
Barite | Level 11

It could be easier to output a simple slide with just the graph and no border to PowerPoint and edit it there.
ods graphics/noborder;
options nodate nonumber;
ods powerpoint file ="C:\Users\User\Desktop\example.pptx" ;
***simplified sgpanel code***;
ods powerpoint close;

smg3141
Obsidian | Level 7
This, is a good idea. Thank you!
DanH_sas
SAS Super FREQ

For the record. we added options to SGPANEL to control the header border and color starting with version 9.4m3 (NOHEADERBORDER and HEADERBACKCOLOR). It appears that you have 9.4m2, so those options are not available for you until you upgrade.

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
  • 3 replies
  • 543 views
  • 3 likes
  • 3 in conversation