PROC GCHART - how to define colors for stacked graph

Reply
Frequent Contributor
Posts: 134

PROC GCHART - how to define colors for stacked graph

Hi,

I am using PROC GCHART to draw a vertical bar chart with stacked groups. Charts are generated with automatic colors for categories.

is there a way I can define colors for individual category, as an example make category A as black and so on

Thanks

SAS Super FREQ
Posts: 8,868

Re: PROC GCHART - how to define colors for stacked graph


Hi:

  If you have very regular data and no missing values, you can use the PATTERN statement to ensure the colors for each group. But if you have one group with some Category A missing and some with Category A present, you may have to use this technique with GCHART: http://support.sas.com/kb/24/874.html

  With ODS GRAPHICS, you have an easier time of it. You can refer to this PROC SGPLOT example on using an attribute map file: http://support.sas.com/documentation/cdl/en/grstatproc/65235/HTML/default/viewer.htm#p18q268a3zxcl3n... (shows how to make apples always red, bananas always yellow, etc)

cynthia

Ask a Question
Discussion stats
  • 1 reply
  • 180 views
  • 0 likes
  • 2 in conversation