02-06-2015 12:48 PM
So this is my code thus far:
PROC SGPANEL DATA=new&file;
PANELBY nb/rows=&rows columns=&cols spacing=5 novarname;
FORMAT nb &fmt..;;
%IF %UPCASE(&refline)^= %THEN %DO;
refline &refline / axis=y lineattrs=(pattern=5);
rowaxis values=(&range) label="&label";
refline 0 / axis=y;
This is the bottom of the output
Sadly This is the labels I need to keep for this graph, but I am hoping to make it so it doesn't present it at an angle, but instead multiple lines.. I was told I should split the character label, but I have no idea how to do that. I did find the splitchar statement (SPLITCHAR=“character-list") within the SAS documentation, but I can't find examples on how to apply it. I am unsure if this is the right statement that I should use to make it the way I want it.
Does anyone have any ideas?
02-06-2015 02:59 PM
Since you see the SPLITCHAR option in the doc, you are likely using SAS9.4 or later release. You need to set the FITPOLICY=SPLIT on the COLAXIS. Here is sample code and what you get.
ods graphics / reset width=8in height=3in;
proc sgpanel data=sashelp.heart;
panelby weight_Status / columns=3 onepanel ;
02-09-2015 03:43 PM
Thanks for this, I was wondering, is there a way for it to work on 9.2 also? So I am on 9.4 but other coders I am working with are on 9.2.
02-09-2015 05:01 PM
No, there is no simple option prior to SAS 9.4 that will do this for you.
With SAS 9.3, you can use the SG Annotatio feature to draw split tick values with some extra effort. You will need to turn off the axis tick values, and use the SG Annotation TEXT function to render the values. This function can automatically split the words in a text string in a certain width.
For SAS 9.2, my suggestion would be to switch the Row and Col axis variables so the long text strings will go you the Y axis.