I almost have my hbar chart where I need it to be, with the following exceptions:
1) My bars are "stacked" using a subgroup variable - I have each subroup labeled with its percent value. However, I cannot figure out how to get the percent value centered within its area of the bar. Here is the code used to label the subgroups - I have the code "annotate=barlabel" as an option in my hbar statement:
data barlabel; length color style $ 8; retain color 'black' when 'a' style 'swissb' xsys ysys '2' position '[less than sign]' size 2 hsys '3'; set stats;
midpoint=s;
subgroup=response;
text=left(put(percent,5.));
run;
*Note: I needed to indicate the "less than" sign with words above because otherwise it would cut my post short.
2) I cannot, for some reason, change the label or values of the vertical axis - I am trying to change the font and use right justify, but nothing happens. Here is the rest of the code I am using:
legend1 across=3 shape=bar(3,2) label=none position=(bottom outside center)
value=(font='arial' h=8pt 'Positive Top 3' 'Neutral Middle 3' 'Negative Bottom 3');
proc format; picture pctfmt (round) 0-high='000%'; run;
proc gchart data=stats;
axis1 order=(0 to 100 by 10) minor=(n=1) label=none value=(font='arial' height=8pt);
axis2 label=(font='arial' height=8pt justify=right) value=(font='arial' height=8pt );
hbar s/discrete sumvar=percent subgroup=response type=sum nostats width=3
vref=100 coutline=black frame raxis=axis1 legend=legend1 annotate=barlabel;
format percent pctfmt.;
run; quit;
If anyone has any suggestions, I would be extremely grateful.
Thanks in advance!