我正在使用宏来生成许多类似的水平条形图。图表宽度根据标签(垂直轴)的长度而变化。
如何使所有图表的宽度相同,导致标签自动换行以进行调整?
data my_annoDetailedChart&i; set FinalDim&i;
xsys='2'; ysys='2'; hsys='3'; when='a';
group=itemname;
midpoint=entity;
x=score;
function='label'; position='>'; color='grayaa'; size=1.5;
text=" "||trim(left(put(score,comma5.2)));
goptions device=png;
goptions xpixels=700 ypixels=450;
goptions noborder;
goptions cback=white;
goptions gunit=pct ftitle="albany amt/bold" ftext="albany amt" hsize=6.5 vsize= 7.6 inches
htitle=4.1 htext=1.5 ctext=gray44;************************************************************************************************************;
*---Indicators---------------------------------------------------------------------------------------------;
pattern1 v=solid c=navy; /* blue */
pattern2 v=solid c=lightgray; /* green */
pattern1 v=solid c=navy; /* blue */
pattern2 v=solid c=lightgray; /* green */
axis1 SPLIT="*" label=none order=(1 to 5 by .5) minor=none offset=(0,0)
color=graydd major=(color=gray44) value=(color=gray44);
axis2 SPLIT="*" label=none value=none ;
axis3 label=none offset=(3,3);* order=( &KOko);
legend1 position=(bottom right inside) mode=share label=none shape=bar(.15in,.15in) offset=(-1,-0.1);
proc gchart data=FinalDim&i anno=my_annoDetailedChart&i;
hbar entity / discrete type=sum sumvar=Score nostat
subgroup=entity group=itemname space=0 gspace=1
raxis=axis1 maxis=axis2 gaxis=axis3 autoref
legend=legend1 clipref ;
title color=navy h=6 font="Times New Roman" "&Dimension";