BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I would like to maintain the order of my data according to the variable q1 ("Strongly Agree" "Agree" "Disagree" "Strongly Disagree") in the following code:
proc gchart data=bar6;
hbar role / discrete
type=sum sumvar=perq
subgroup=q1

"role" is either "manager" or "employee".
I would like the subgroup bars on my gchart (ie q1) to be in the order given above (along with the legend having that order).
Also, I would like to maintain the colors used in my legend (eg "Strongly Agree" is always red, "Agree" is always orange, etc).

I created a varible q where "Strongly Agree"=1, "Agree"=2, etc and sorted accordingly.
Is there an option for order=data?
2 REPLIES 2
abdullala
Calcite | Level 5
1. use variable q instead of q1 in chart; 2.create format for 1,2,3 to display strongly,agree,etc; 3.define format for variable q in proc gchart.
Bill
Quartz | Level 8
here's a link an example for keeping the colours constant ... http://support.sas.com/kb/24/874.html

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 2 replies
  • 697 views
  • 0 likes
  • 3 in conversation