DATA Step, Macro, Functions and more

Custom color of barcharts in proc template

Reply
Regular Learner
Posts: 1

Custom color of barcharts in proc template

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!! Smiley Happy

SAS Super FREQ
Posts: 8,742

Re: Custom color of barcharts in proc template

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
Ask a Question
Discussion stats
  • 1 reply
  • 193 views
  • 0 likes
  • 2 in conversation