|
You can create a pattern list based on the x value for each month,
which can be done be proc sql and format, then apply the patterns
to proc gchart:
data xx;
do month=1 to 12;
pct=int(ranuni(2)*100);
output;
end;
run;
proc format;
value pctcol
0-50='red'
51-75='green'
76-100='blue'
;
options symbolgen;
proc sql noprint;
select 'pattern'||trim(put(month,best.-l))||' color='||trim(put(pct,pctcol.-
l))
into :colfmt separated by ';'
from xx
;
&colfmt;
proc gchart;
hbar month / discrete sumvar=pct subgroup=month nolegend;
run;
455 &colfmt;
SYMBOLGEN: Macro variable COLFMT resolves to pattern1 color=red;pattern2
color=blue;pattern3 color=blue;pattern4 color=green;pattern5
color=blue;pattern6 color=blue;pattern7 color=red;pattern8
color=red;pattern9 color=red;pattern10 color=red;pattern11
color=green;pattern12 color=red
456
NOTE: PROCEDURE SQL used:
The above log shows how the pattern statements were built up.
HTH
Ya Huang
On Mon, 2 May 2005 11:28:51 -0400, Srinivas Reddy Valisekkagari
<reddy.srinivas@GMAIL.COM> wrote:
>Hi,
> I have a bar chart(hbar) with Month on y-axis and corresponding %
>values on x-axis.
>
>ex:-
>===
>Jan 80%
>Feb 90%
>Mar 95%
>
>In the Graph based on % values ,i want to change the color of y-axis values
>based on conditions like :
>
>if % <= 80 then show axis value in RED
>
>if 90 <= % < 80 then axis value is Blue
>
>if % > 90 then axis value is Green.
>
>Is there a way to accomplish this ? I am using SAS Version 8.2.
>
>Any help/suggestions will be appreciated.
>
>Thanks,
>-Reddy
|