Hi all,
Normally I am using VBAR from the SGPLOT Procedure to create single bar charts. Now I want to build a chart matrix with several plots using the SAS Graph template. Everything works fine except that I can not replicate some functionality from VBAR statement with the BARCHART Statement.
I want to order a stacked bar chart in a descending order, which means the bars should be ordered from the largest to the smallest, as well as each stacked bar should be ordered by the size of each categorical level.
VBAR provides the “CATEGORYORDER = RESPDESC” option which solves my problem, but the same option is not working with the BARCHART Statement. Does anyone knows a workaround which leads to the same solution?
BR
TSAS
The SGPLOT and SGPANEL procedures do some extra processing to support this feature. There is not a direct option in GTL to do it. To do this GTL, there four key items:
Let me know if you still have issues.
I solved my issue. I forgot to mention that my dataset contains two columns with data which need so be sorted independently first. @ DanH_sas your suggestion did not work completely for my problem but put me on the right track. Thanks for that! I solved my issue by following your logic with proc sql in advance.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.