Hello, I'm having trouble getting the dates along the bottom of my line graph to go away. They are too crowded, and I'd like them to show as a year, but I'm not sure what code I would add for that:
/*
*
* Task code generated by SAS Studio 3.8
*
* Generated on '10/20/24, 12:32 PM'
* Generated by 'u64056563'
* Generated on server 'ODAWS01-USW2.ODA.SAS.COM'
* Generated on SAS platform 'Linux LIN X64 5.14.0-284.30.1.el9_2.x86_64'
* Generated on SAS version '9.04.01M7P08062020'
* Generated on browser 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Edg/130.0.0.0'
* Generated on web client 'https://odamid-usw2.oda.sas.com/SASStudio/main?locale=en_US&zone=GMT-05%253A00&ticket=ST-85165-NheEFQyTPDwjsJpxToFs-cas'
*
*/
ods graphics / reset width=12in height=3in imagemap;
proc sgplot data=WORK.IMPORT2;
title height=14pt "Federal Reserve GDP Quarterly";
footnote2 justify=left height=12pt "Real Gross Domestic Product, Percent Change from Preceding Period, Quarterly, Seasonally Adjusted Annual Rate";
vline VAR1 / response=VAR2;
xaxis label="Observation Date" valuesrotate=vertical;
yaxis grid label="GDP Percent Change";
run;
ods graphics / reset;
title;
footnote2;
Most of us will not download Microsoft OFfice documents as they can be security threat. Please make a screen capture of your plot and then include the screen capture in your reply by clicking on the "Insert Photos" icon. Do not attach files.
Also, what are typical values of variable VAR1?
There are two possible ways to fix this:
1) If there is no summarization going on with your data, use a SERIES plot instead of a VLINE chart
2) If there is summarization involved, and the VAR is a DATETIME variable, just set TYPE=TIME on the XAXIS statement to override the default DISCRETE axis type used for VLINE charts.
Hope this helps!
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.