BookmarkSubscribeRSS Feed
JB_DataAnalyst
Obsidian | Level 7

Hello,

 

I have two groups in my table. How could I customized the color that lets say group 1 is red and group 2 is blue or

 

my startcolor is red and endcolor is blue

 

Please help

 

Thanks!! 🙂

1 REPLY 1
Cynthia_sas
Diamond | Level 26
Hi:
It depends partly on how you are creating your bar charts: SAS/GRAPH or ODS GRAPHICS. And, what kind of template? A style template or a graph template? Generally, grouped data is given colors by the GDATA1-GDATA12 style elements in a style template. If you change the colors in the style template, then the style template colors will be used unless you have other overriding statements. I have an example of changing bar chart colors in the paper:
https://support.sas.com/resources/papers/proceedings10/033-2010.pdf

But there are other ways to change the color, too. If you always want one group to be red and the other group to be blue and, if you are using ODS GRAPHICS, then an attribute map is another way to change colors based on a group value. It really depends on how you are creating the graphs.

cynthia

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 3942 views
  • 0 likes
  • 2 in conversation