Displaying nicely rendered axis values reduces clutter and makes the graph more readable. With SAS 9.4, we added the ability for splitting x-axis tick values on white space to create a nice and readable x-axis as shown in the graph on the right.
It is always a challenge to fit long tick values on the x-axis. With SAS 9.4, a new "FitPolicy" was added to GTL to split tick values on white space, and to fit these in the available space automatically. SGPLOT went a step further and made it the default fit policy (FitRotate). Now, knowing the space available on the x-axis for each tick value, first the procedure will try to split the long values on white space, and if the longest word still does not fit, we rotate the values.
Prior to SAS 9.4, the default policy was to rotate tick values at 45 degrees if the entire value did not fit on one line on the x-axis. This caused the tick values to be displayed as shown on the right. While the graph on the right is not adversely affected, when values are long, this can take away a lot of space from the available height of the graph.
There are many cases of bar charts that have many category values on the x-axis, and users have asked for a way to display the x-axis values rotated vertically.
With SAS 940M3, we added the ability to rotate the tick values vertically, as shown in the graph on the right. For SGPLOT, use VALUESROTATE=vertical. For GTL use TICKVALUEROTATION in the DiscreteAttrs bundle. Note the values are oriented bottom to top to match the axis label orientation on Y or Y2 axis.
title 'Height by Name';
proc sgplot data=sashelp.class
vbar name / response=height
xaxis display=(nolabel noline noticks)
A few users have asked for an option to display the x-axis tick values such that the direction is vertical (top down), but each glyph is shown unrotated. This is sometimes also referred to as "Hotel" text, as shown on the right. This type of layout is not available at this time.
This layout may also be useful with many Asian languages. If this is important for your applications, please chime in or call in the request to SAS Technical Support.
SAS Code: tickvalueangle2