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 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 808 views
  • 2 likes
  • 4 in conversation