BookmarkSubscribeRSS Feed
SAS93
Quartz | Level 8

I have the following code:

 

/* Vertical Bar Chart */
Axis order=("NH White" "NH other" "Hispanic" "NH Black");
Proc GCHART data=WORK.RACEFLU3;
Vbar race / sumvar=rowpercent raxis=axis;
Run;

 

It displays the % of people vaccinated (numeric) by race/ethnicity (character). I'm trying to get those race/ethnicity categories to appear sorted by descending % on the horizontal axis (so: "NH White" "NH other" "Hispanic" "NH Black").

But whatever I'm doing above doesn't work and the suggestions I've found so far online don't really help, either.

 

Any ideas?

1 REPLY 1
Reeza
Super User

1. Sort your data before graphing. 

2. Try SGPLOT + HBAR/VBAR which allows you a little more control than SAS/GRAPH.

 

If you need help with code, please post sample data or provide code that uses one of the datasets in the SASHELP library, such as CLASS, CARS or HEART.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 1 reply
  • 326 views
  • 0 likes
  • 2 in conversation