BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
tc
Lapis Lazuli | Level 10 tc
Lapis Lazuli | Level 10

Ok, this should be simple, but I'm stumped.

I've created a discrete attribute map to vary the colors in a stacked bar chart (SGPLOT VBAR), which automatically gets tied to the GROUP variable, but I'd like to tie it instead to a different variable.

When I specify a different COLORRESPONSE variable, however, a completely different set of colors - not those in the discrete attribute map - are used.

So, my question is: How do I tie the COLORRESPONSE variable to the colors in the discrete attribute map?

Or is this not possible with SGPLOT and I'll have to use GTL (e.g., DISCRETEATTRVAR)?

Thanks!

Tc

1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

COLORRESPONSE variables cannot be tied to discrete attrmaps, even in GTL. You need to use a RANGE attrmap instead, It gives you the ability to associate a single color to a range, or even a list of colors to a range so that the colors vary across the range.  Take a look at page 13 of my paper a did a couple of years ago, and let me know if you have any questions.

 

Thanks!

Dan

 

https://support.sas.com/resources/papers/proceedings17/SAS0675-2017.pdf

 

View solution in original post

2 REPLIES 2
DanH_sas
SAS Super FREQ

COLORRESPONSE variables cannot be tied to discrete attrmaps, even in GTL. You need to use a RANGE attrmap instead, It gives you the ability to associate a single color to a range, or even a list of colors to a range so that the colors vary across the range.  Take a look at page 13 of my paper a did a couple of years ago, and let me know if you have any questions.

 

Thanks!

Dan

 

https://support.sas.com/resources/papers/proceedings17/SAS0675-2017.pdf

 

tc
Lapis Lazuli | Level 10 tc
Lapis Lazuli | Level 10

Thanks - your suggestion worked like a charm! Man LOL

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 2 replies
  • 756 views
  • 2 likes
  • 2 in conversation