DATA Step, Macro, Functions and more

Custom color of barcharts in proc template

Regular Learner
Posts: 1

Custom color of barcharts in proc template



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

Posts: 9,365

Re: Custom color of barcharts in proc template

Posted in reply to JB_DataAnalyst
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:

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.

Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation