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.
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.
Can you provide some example data, and the code you're currently using?
I got it figured out now, thanks.
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
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!
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.