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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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