BookmarkSubscribeRSS Feed
radha009
Quartz | Level 8

i have vbar bar graph. the x-axis labels are displaying very long.How can we wrap the text.

 

tt.jpg

4 REPLIES 4
DanH_sas
SAS Super FREQ

What version of SAS are you running?

radha009
Quartz | Level 8

SAS 9.4 windows

ballardw
Super User

Two options combined and a change to your data.

The XAXIS option FITPOLICY controls how text for tickmarks displays. The Options Fitpolicy=Split, Splitalways or SplitRotate work with the option SPLITCHAR option to indicate one or more characters to split the text.

So if your xaxis statement includes Fitpolicy=Split Splitchar='*" any label on a discrete axis will split the text where the * occurs.

The split character(s) are not displayed in the result.

Following the above if the value of the X variable is "This long label*wants to be*split"

Then the result would look something like:

This long label

wants to be

split

Actual appearance depend on which of split, splitalways and splitrotate you use. See documentation for details.

 

You can have more than one splitchar but the order isn't important, there is no "use the * and then the ! if you use splitchar="*!" as splitchar="!*" will behave the same.

DanH_sas
SAS Super FREQ

This reason I asked the version question is that we made FITPOLICY=SPLIT the default for the X-axis in 9.4. The default SPLITCHAR is a space. So, I would have expected your axis value to split on the space, but they did not. By any chance, do you have FITPOLICY=ROTATE in your SGPLOT code?


Thanks!

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
  • 3431 views
  • 0 likes
  • 3 in conversation