FITPOLICY and SPLITCHAR on XAXIS statement.
data have;
input Id Option1 Option2 Option3 Option4;
label option1 = 'Question really long text # to force split 99' option2 = 'Random Text with #another random split' option3 = 'Demoe' option4 = 'House';
cards;
1 0 0 0 1
2 0 0 1 0
3 0 1 0 1
4 1 0 1 1
;
run;
ods select none;
ods output summary=summary_results;
proc means data=have stackods mean;
var option1-option4;
run;
ods select all;
proc sgplot data=summary_results;
vbarparm response=mean category=label;
format mean percent12.1;
label mean = 'Response';
xaxis fitpolicy=split splitchar='#';
run;
@NeilH wrote:
Worked perfectly, Reeza!
My one issue with the current labels I have, is that a few of them are quite long and crowd out the chart. I'll research this, but if you know of a word wrap option that can be applied to the labels in sgplot or an alternative, that would be great. I think I see how to add a line break in the label itself when it's set - (*ESC*){unicode '000a'x}. But it's not appearing as I'd hope in the chart itself. Below is an example of a lengthy label without a newline in it. The chart displays perfectly for shorter labels.
... View more