Help using Base SAS procedures

Modifying colours for PATTERN statement

Accepted Solution Solved
Reply
Contributor
Posts: 71
Accepted Solution

Modifying colours for PATTERN statement

I wonder if there is a way to automatically change the colours of pattern statement in proc gchart. E.g if the value of chart variable is negative then display the bar chart in red, otherwise in green (like traffic lights method).

Thanks.


Accepted Solutions
Solution
‎08-03-2011 07:12 AM
SAS Super FREQ
Posts: 8,740

Modifying colours for PATTERN statement

Hi:

   In this Tech Support note, they "pre-test" the values in the data to create macro variables which will be used to set the colors of the bars based on what is in each of the BY group values. So you could use a similar technique to set PATTERN statements for your scenario.

http://support.sas.com/kb/24/874.html

  This description of how the PATTERN statement works is very useful -- you have to understand the behavior of PATTERN when a color is specified vs when a color is NOT specified and how the PATTERN statement can be "cycled":

http://support.sas.com/documentation/cdl/en/graphref/63022/HTML/default/viewer.htm#patternchap.htm

cynthia

View solution in original post


All Replies
Solution
‎08-03-2011 07:12 AM
SAS Super FREQ
Posts: 8,740

Modifying colours for PATTERN statement

Hi:

   In this Tech Support note, they "pre-test" the values in the data to create macro variables which will be used to set the colors of the bars based on what is in each of the BY group values. So you could use a similar technique to set PATTERN statements for your scenario.

http://support.sas.com/kb/24/874.html

  This description of how the PATTERN statement works is very useful -- you have to understand the behavior of PATTERN when a color is specified vs when a color is NOT specified and how the PATTERN statement can be "cycled":

http://support.sas.com/documentation/cdl/en/graphref/63022/HTML/default/viewer.htm#patternchap.htm

cynthia

Contributor
Posts: 71

Modifying colours for PATTERN statement

Cynthia,

Thanks a lot for this, I adapted it to my code and it works very well!

Much appreciate it,

Fethon

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 131 views
  • 0 likes
  • 2 in conversation