BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
palolix
Pyrite | Level 9

Dear SAS Community,

 

I would greatly appreciate it if you could let me know how to include percent of frequency inside all levels of the Variable Peel Color in this graph. For some levels the % is included in the bars, but not for all levels.

palolix_0-1760045648586.png

This is the code I am using:

 

ods powerpoint file='Storage PeelColor BL516 Harvest.pptx'image_dpi=300;
title "Storage PeelColor: BL516 vs Hass by Harvest month";
proc sgpanel data=one pctlevel=group;
where Harvest in(1,2,3,4,5,6,8) and Variety in('BL516','Hass');
panelby Harvest / columns=7 onepanel;
vbar Variety / group=PeelColor grouporder=ascending stat=percent
groupdisplay=stack seglabel;
run;
ods powerpoint close;

 

Thank you very much

1 ACCEPTED SOLUTION

Accepted Solutions
quickbluefish
Barite | Level 11
Add SEGLABELFITPOLICY=NONE right after the SEGLABEL part.

View solution in original post

5 REPLIES 5
quickbluefish
Barite | Level 11
Add SEGLABELFITPOLICY=NONE right after the SEGLABEL part.
palolix
Pyrite | Level 9

Thank you so much for your quick reply, it was very helpful.

Is there a way remove them completely? If I don't include that statement I still get percentages in some bars but not others. 

 

palolix_0-1760110790793.png

 

 

 

Thank you very much

Ksharp
Super User

You can try to switch VBAR into VBARPARM:

 

proc sort data=sashelp.heart out=have;
by smoking_status sex;
run;

proc freq data=have noprint;
by smoking_status sex;
table bp_status/out=have2 ;
run;
data have2;
set have2;
percent2=percent/100;
format percent2 percent8.2;
run;


proc sgpanel data=have2;
panelby smoking_status / rows=1 onepanel novarname;
vbarparm  category=sex response=percent2/ group=bp_status grouporder=ascending
groupdisplay=stack seglabel seglabelfitpolicy=none;
run;

Ksharp_0-1760081166683.png

 

palolix
Pyrite | Level 9

Thank you for your response Ksharp!

palolix
Pyrite | Level 9

Nevermind, I was only getting some percentages because I was not including the seglabel option.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 5 replies
  • 239 views
  • 4 likes
  • 3 in conversation