BookmarkSubscribeRSS Feed
aigiss
Obsidian | Level 7

As shown in the photo below, you see that female has no data labels for its bars. Any way to improve this graph? Many thanks!

 

aigiss_0-1677785726203.png

proc sgpanel data=k.combined_dataset ;
  title 'Percentage of Sexual Orientation among Gender in Sexual and No-reported Sexual Contact MPX Cases';
panelby genderid / layout=columnlattic novarname;
vbar genderid / group=AdtlDemOrient stat=percent categoryorder=respasc groupdisplay=cluster seglabel
  datalabel;
where genderid="Male" | genderid="Female";
rowaxis grid display=(noticks nolabel);
colaxis grid display=(noticks nolabel);
keylegend/title='Sexual Orientation';
run;
1 REPLY 1
Ksharp
Super User
If you want answer, you would better to post your example data to replicate your error.
From the code you posted, why put genderid in VBAR since VBAR is in PANELBY ?
You could try :

vbar genderid / group=AdtlDemOrient stat=percent categoryorder=respasc groupdisplay=cluster seglabel
datalabel;
----->
vbar AdtlDemOrient / group=AdtlDemOrient stat=percent categoryorder=respasc groupdisplay=cluster seglabel
datalabel;

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
  • 1 reply
  • 698 views
  • 0 likes
  • 2 in conversation