05-19-2015 04:25 AM
I'm currently trying to find a way to customize colors in a stacked bar chart. The colors are currently blue/red.
Here is an example of my code:
proc sort data=t.indic_f;
proc freq data=t.indic_f noprint;
proc sgplot data=test3;
vbar A / response=Percent group=RETARD_PAT groupdisplay=stack;
yaxis grid values=(0 to 100 by 10) label="Percentage of Total with Group";
format RETARD_PAT retards.;
I've done a lot of research to no avail... Thanks!lot
05-19-2015 10:17 AM
A good idea for a sticky this. If your having any graph issues or need some examples on things, search this extremely helpful blog:
Pretty much everything you can imagine is covered, normally with sgplot and template examples. In your case you might get away with %modstyle() macro call:
05-19-2015 10:25 AM
If you have SAS 9.3 or greater, you can create an attributes map to assign attributes (including color) to specific group values. If you do not care about specifically assigning colors, and you have SAS 9.4 or greater, you can use the DATACOLORS option on the new STYLEATTRS statement to control those colors without modifying the ODS style. Modifying the ODS style is always an option in any release.
Hope this helps!