BookmarkSubscribeRSS Feed
rab24
Calcite | Level 5
I have line graphs with date labels along the horizontal axis. In EG, the labels are staggered horizontally, but I can manually adjust the labels to have either a vertical or angled layout. Is there a way I can write the SAS code to make the graphs automatically have a vertical layout?

Turnhlabels is the only line of code I have found, but I can't make it work with proc gcharts.
3 REPLIES 3
Cynthia_sas
SAS Super FREQ
Hi,
The AXIS statement will allow you to change the rotation of the label (like 'DATE') or the rotation of the variable values (like '01JAN06' or '01FEB06').
The syntax on the axis statement is very straightforward, and you can select it in the EG task window. The syntax will be something like:
[pre]
AXIS1 minor=none label=(angle=45) value=(angle=45);

[/pre] but then you have to link the AXIS statement with the SAS/Graph procedure. So, for example, if your procedure of choice is PROC GPLOT, then you would issue a PLOT statement like this:
[pre]PLOT YVAR*XVAR/ HAXIS=AXIS1; [/pre]
Basically, it's the same thing with PROC GCHART, only you would have something like:[pre]
vbar3d chartvar / maxis=axis1; [/pre]
specified for the horizontal axis or midpoint axis.

However, there is not a good way to set this as the default all the time, because you might want to use a different AXIS statement with different SAS/Graph procedures.

When you are in EG, look under the Horizontal Axis choice in the navigation panel. When you are working with the Horizontal axis, you will find a tab for the Label and a tab to change the Value. You can change the label rotation on the Label tab and the value rotation on the value tab. This should put the correct code into your EG project.
Hope this helps,
cynthia
rab24
Calcite | Level 5
Thank you. The code works perfectly.

But I still can't find this option in EG3 for scatter plots.
Cynthia_sas
SAS Super FREQ
Sorry, I only have EG4 to test with. When I do a Scatter Plot in EG4 and select the click path:
Graph --> Scatter Plot

and then after selecting Task Roles for my data (to put my date on the horizontal axis), I can select:
Horizontal Axis --> Label TAB --> Label Rotation --> 45
(the Label Rotation choice is under the big white box for entering the Label value) and
Horizontal Axis --> Values TAB --> Value Rotation --> 45
(The Value Rotation choice is directly underneath the drop down box for selecting a Font for the Values)


You may have to contact Tech Support to find out how to do this in EG 3. I -thought- the rotation option was also available in the Task Window in EG3.
cynthia

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 3 replies
  • 817 views
  • 0 likes
  • 2 in conversation