BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Leo9
Quartz | Level 8

Hi All,

I am trying to create a higlow graph. I want to color the bars with different colors based on the treatment subject received.  For some reason this is not working as desired. I first created this dataset

data barcol ;

length id value fillcolor $50 ;

retain linecolor "black" ;

id = "coh"; value = "a" ; fillcolor = "red" ; output;

id = "coh"; value = "b" ; fillcolor = "green" ; output;

id = "coh"; value = "c" ; fillcolor = "orange" ; output;

run;

 

then I used this in proc sgplot statement

 

proc sgplot data=final  noautolegend nocycleattrs dattrmap=barcol;

styleattrs wallcolor = lightyellow ;

highlow y=subj low=start high=end1 / highcap=acap group=coht type=bar nooutline nomissinggroup transparency=0.1 name = 'proj' attrid = coh ;

 

Any suggestions ?

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

What are the formatted values of the variable Coht?

If you have a default format for the variable that displays text other than 'a' 'b' 'c' then the values don't match.

Or if the actual values and no custom format is assigned then 'A' is not the same as the 'a' in the dattrmap data set.

View solution in original post

2 REPLIES 2
ballardw
Super User

What are the formatted values of the variable Coht?

If you have a default format for the variable that displays text other than 'a' 'b' 'c' then the values don't match.

Or if the actual values and no custom format is assigned then 'A' is not the same as the 'a' in the dattrmap data set.

Leo9
Quartz | Level 8

Thanks for your response. I realize the mistake I made. It seems that same variable has to be used in group and attrid (atleast with same value). 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 591 views
  • 0 likes
  • 2 in conversation