BookmarkSubscribeRSS Feed
admendez03
Fluorite | Level 6

I am having trouble with changing the colors of certain bars by variable in SGPANEL. I want the response variable "Yes" to be one color and "No" to be another color. I am using SAS University. I want the colors limegreen and darkcyan. Here is my code and a screenshot:

 

title2 h=12pt'Percent of Americans Aged 20 and Older Who Adhered to Cholesterol Screening Guidelines by Insurance
and Routine Care Provider, 2011-2012';
proc sgpanel data=nh.crossfinal;
styleattrs datacolors=(limegreen darkcyan);
panelby cho5years care;
rowaxis label="Percent" grid max=100.0;
vbar ins / response=percent
filltype=solid
dataskin=gloss name='ins'
fill datalabel
fillattrs=(color=limegreen);
label ins='Insurance'
care='Routine Care'
cho5years='Cholesterol Screening';
format ins decision. care decision.;
run;
title2;

 

Screen Shot 2020-11-20 at 19.25.49.png

2 REPLIES 2
Ksharp
Super User

DON'T USE  
fillattrs=(color=limegreen)

 

 

 

ods graphics/ attrpriority=color;
proc sgpanel data=sashelp.heart;
styleattrs datacolors=(green red) datacontrastcolors=(green red);
panelby status sex;
rowaxis label="Percent" grid max=100.0;
vbar  bp_status / group=sex groupdisplay=cluster
filltype=solid
dataskin=gloss name='ins'
fill datalabel;
run;

x.png

GraphGuy
Meteorite | Level 14

Here's an example where I use an attribute map to control colors in sgpanel:

 

https://blogs.sas.com/content/graphicallyspeaking/2019/04/15/does-low-unemployment-mean-there-are-jo...

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1721 views
  • 2 likes
  • 3 in conversation