BookmarkSubscribeRSS Feed
katslau
Fluorite | Level 6

I have X variables with very long names. How can I customize the labels so that the text can wrap instead of long slanted words? I only have 5 types of variables for X and then frequency for Y, something like below. I'm using PROC TEMPLATE + PROC SGRENDER to make the barchart because I have a large amount of data and it's much easier to get a total for each X variable than creating the frequency of each observation.

 

katslau_0-1629334243406.png

 

4 REPLIES 4
ballardw
Super User

X variables with "long names"? Limit on a variable name is 32 characters so that can not be the issue.

 

If you are showing the Value of the variables then you can create custom format to show less text. Then in the SGrender apply the format to the variable. If you are showing the Label associated with the variable the assign a different label in the Sgrender call.

 

Don't really see anything that really needs GTL though, looks like a basic Vbar chart with a data label. If you have 4 variables holding the response to a single question then you may have a poor data structure.

GraphGuy
Meteorite | Level 14

Can you provide some example data, and the code you're currently using?

katslau
Fluorite | Level 6

I got it figured out now, thanks.

DanH_sas
SAS Super FREQ

First of all, this example should be simple to do with Proc SGplot. The code would look something like the following:

 

Proc SGplot data=symptom_data;
axis fitpolicy=split;
vbar symptoms / datalabel;
run;

In GTL, the option you want for your axis values is TICKVALUEFITPOLICY=SPLIT.

 

Hope this helps!

Dan

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
  • 4 replies
  • 500 views
  • 2 likes
  • 4 in conversation