Data visualization with SAS programming

gchart: maintain data order

Reply
N/A
Posts: 0

gchart: maintain data order

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?
Contributor
Posts: 74

Re: gchart: maintain data order

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.
Super Contributor
Posts: 291

Re: gchart: maintain data order

here's a link an example for keeping the colours constant ... http://support.sas.com/kb/24/874.html
Ask a Question
Discussion stats
  • 2 replies
  • 114 views
  • 0 likes
  • 3 in conversation