Hello, I'm having some trouble displaying annotated data on a grouped VBAR. Example code below. I want to display an 'x' at the bottom of each Bar, i.e. the position of the 'x' is tied to the data value of each bar. However when I run I get the following Warning and the 'x' is not displayed on the output: WARNING: DrawText statement has missing/invalid value for position (X or Y). Draw statement discarded. data data1;
length genx genid $ 10;
genx = 'GRP1';
genid = 'HRD1'; d1=15; output;
genid = 'HRD2'; d1=23; output;
genid = 'HRD3'; d1=5; output;
genid = 'HRD4'; d1=35; output;
genx = 'GRP2';
genid = 'NONHRD1'; d1=43; output;
genid = 'NONHRD2'; d1=28; output;
genid = 'NONHRD3'; d1=26; output;
genid = 'NONHRD4'; d1=9; output;
run;
data anno_ds;
set data1;
function = 'text';
x1space = 'datavalue';
y1space = 'layoutpercent';
textsize = 6;
textweight = 'normal';
width = 20;
widthunit = 'percent';
anchor = 'center';
xc1 = genid;
y1 = -1;
label = 'x';
run;
ods graphics on / reset height=6.8in width=8.5in imagename='test' noborder;
proc sgplot data=data1 noautolegend sganno=anno_ds pad=(bottom=10pct);
vbar genx / group=genid response=d1 groupdisplay=cluster
dataskin=pressed ;
xaxis label='Grouped data' display=(noticks) valueattrs=(size=7 family=Arial weight=bold) labelattrs=(size=7 family=Arial weight=bold);
yaxis label='Score (%)' values=(0 to 100 by 10) valueattrs=(size=7 family=Arial weight=bold) labelattrs=(size=7 family=Arial weight=bold);
run; Thank you for looking, Chris.
... View more