Hi there, I am trying to create a bar chart and think it should be a really really simple task ( you can do this probably in excel under 2 mins or in JMP under 2 mins) but seems like in SAS it is difficult. So I have a simple data table which has two columns (vars): Location and Value; Location could be three different values and value is between 0 to 1; I am trying to use PROC GCHART to make a bar chart and the X axis is Location and Y axis is ValueT; in addition, I want to assign the bar chart color based on the ValueT; if valueT < 50, then bar should be red; if 50<= valueT<80, then yellow; and if valueT >= 80, then green, I also create a new variable called barcolor to assign the value as 1 2 3 to represent red yellow green . however, for my data table, sometimes it has values all over 80, some times values are all above 50, then if i use the pattern to assign the color to the bar, there will be a problem. proc gchart data=test; vbar Location / discrete sumvar=ValueT sum subgroup=barcolor nolegend ref=50 80 cref=(red green) maxis=axis1 raxis=axis2; pattern1 value=solid color=red; pattern2 value=solid color=yellow; pattern3 value=solid color=green; axis1 label=("Location"); axis2 label=(angle=90 "ValueT") order=(0.3to 1.0 by 0.1) reflabel=("Action Limit" "Goal"); run; quit; This code will not do the job when the data table does not have all three range of values; if you only have valueT below 50 and above 80, then the first one will be red but values over 80 of locations will show yellow (correct values should be Green). Not sure I can do this in PROC GCHART, if not, are there any easy ways to do this? I searched online and maybe rangeattrmap could do it (need a simple example for my case; have read some examples under SAS docs but not easy to understand).
... View more