is it ever possible to associate the color to a treatment group but NOT using treatment group as 'group' or 'subgroup' to draw bar chart? in fact the treatment group will appear totally randomly, but I want to use a special color to associate with a treatment group.
It will be easier with SAS 9.3 SGProcedures or GTL, as you can create an independent DiscreteAttributesMap, and use that to color the bars. The colors are applied by value of the variable, so you reliably get Drug A to be Blue, regardless of its position in the data. If the value is numeric, you can also use the RangeAttributesMap (GTL).
Depending on what you want to do, you can use VBAR, VBARPARM or HIGHLOW plot as they have different features. If you want to avoid summarization by the group variable, then VBARPARM or HIGHLOW will be more suitable.
This is likely doable using SAS 9.2, with a bit more custom coding.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.