BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
fastb
Fluorite | Level 6

I am creating a panel plot using SGPANEL with v 9.3 and some of the column headers are too long to fit in the column header box.

Instead of wrapping or shrinking the text, the column header names are truncated to fit in the box (in the attached example the column header "A Name That Is Too Long To Fit" is truncated to "A Name That Is Too Lo".

Is there a way to split these names to two lines or any other solution?

 

An additional question about the order of the panels: I have the data sorted with the variable study in a different order than it appears in the plot:

The left panel should be "A Short Name", the next panel "A Longer Name", ..., the right panel "A Name That is Too Long To Fit".

But when SAS makes the graph it sorts the study variable alphabetically and then places the panels in that order.

Is there any way to fix this?

 

 

Here is the code I am using:

proc sgpanel data=raw noautolegend;
panelby study / layout=columnlattice columns = 4
onepanel /*noborder*/ colheaderpos=top novarname;
vbox result / group=entry grouporder = data;
colaxis discreteorder = data;
run; quit;

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

For the second part, we added a SORTORDER option on the PANELBY statement in SAS 9.4 to handle panel sorting needs. However, for 9.3, the  best way to handle this is to do the following:

 

1. Create a column to assign numbers to the string values in the order you want them.

2. Create a user-defined format to turn those numbers back into the string values.

3. Use this column as your PANELBY variable instead of the original string column.

 

Hope this helps!

Dan 

View solution in original post

5 REPLIES 5
shahparth260
Quartz | Level 8

Hello, 

Contributor 

I've the first answer for your question. 

you can update your code  :

 

COLAXIS min= -50 max= 200 valueattrs=(size=10) labelattrs=(size=10) ;

change your labelattrs size accroding to your label 

 

Thanks .

 

 

 

PS
DanH_sas
SAS Super FREQ

For the second part, we added a SORTORDER option on the PANELBY statement in SAS 9.4 to handle panel sorting needs. However, for 9.3, the  best way to handle this is to do the following:

 

1. Create a column to assign numbers to the string values in the order you want them.

2. Create a user-defined format to turn those numbers back into the string values.

3. Use this column as your PANELBY variable instead of the original string column.

 

Hope this helps!

Dan 

shahparth260
Quartz | Level 8
Hi,
Dan

I appreciate for the second part.Thanks for sharing depth knowledge on the SGPANEL and time as well. This is really good information. 🙂

Good day !


PS
fastb
Fluorite | Level 6

Thank you so much shahparth260 and Dan for your replies to my question; I can now create the plot that I need with this information!

shahparth260
Quartz | Level 8
No problem at all ...fastb.
PS

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 3331 views
  • 1 like
  • 3 in conversation