我想根据数值大小改变条形图条的颜色,下面是我想编的程序,不太对,还请大家帮忙看看,这个怎么实现?
%macro colors(i=,x=);
%if &x>0 %then color=(red blue );
%else color=(blue red );
goptions hsize=5.4in vsize=1.5in colors=&color ;
axis1 label=none order=(-100 to 100 by 25);
axis2 label=none value=("");
proc gchart data=rank(where=(group='&i'));
hbar group /type=sum sumvar=&x
raxis=axis1 maxis=axis2
width=5.4
nostats
coutline=red
;
run;
%mend colors;
/*排名图的绘制,条的颜色设置??*/
data rank;
input math chinese group$;
cards;
75 50 8
25 25 9
50 -25 13
-25 100 10
;
run;
%colors(i=8,x=math)