When using PROC SGPLOT to create a horizontal bar chart, can I Ieft justify tickmark values? What I'm looking for is something like the AXIS statement's SPLIT option. I can make a tickmark value wrap by embedding a linefeed character in the value, but I haven't found a way to left justify the text:
length name $ 40;
if name="Alfred" then name="Alfred" || '0a'x || "AKA: Alfred the Great";
proc sgplot data=class;
hbar name / response=age stat=sum;
First of all, that was a really creative way to get tick mark splitting :-). Unfortunately, we currently do not have a way for you to set justification on axis tick values. If tick value splitting is something you need often, I would contact Tech Support and give them that feedback.
There is one other alternative. If you are able to use vertical bar charts instead of horizontal, you can use the following GTL example that was created by a colleague here to solve a similar problem. To change the justification, change the VALUEHALIGN option.
define statgraph tickvaluewrap;
layout lattice / columns=1 rowgutter=0 rowweights=(.85 .15) columndatarange=union;
columnaxis / offsetmin=.11 offsetmax=.11 display=none;
barchart x=question y=answer / ;
blockplot x=question block=line / class=n display=(values) valuehalign=center;
length line $20;
input Answer Question $3-70;
do while( lengthn(line) > 0 );
3 #1~How do you~feel today?
4 #2~Would you be~willing to try this~again?
2 #3~Is there some~way to get there~from here?
5 #4~When do you~think this will~be finished,~today?
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.