How do I change colours of different bars in SAS?

3.6k Views Asked by At
proc sgplot data=WORK.CUSTOMERDATA;
    title height=14pt "Bar Chart of Gender";
    vbar Gender / fillattrs= (color=CX024ae6) datalabel;
    
    yaxis grid;
run;

ods graphics / reset;
title;

Bar Chart of Graduated

how do I change the colour of individual bars ? I have tried fill= and styleattrs datacolors= but it doesn't seem to work..

1

There are 1 best solutions below

0
On BEST ANSWER

Should you wish to have one color for the graduated and another for the ones that did not, the following should provide the desired output

proc sgplot data=customerdata;
title height=14pt "Bar Chart of Graduated";
styleattrs datacolors=(blue red) ;
vbar Graduated / group=Graduated filltype=solid datalabel;
yaxis grid;
run;

enter image description here