02-05-2016 01:50 PM
In some cases my x axis is being formatted with year like 2001.5 2002 2002.5. How can I format it as 2001 2002 2003?
define statgraph multiLineGraph2;
overlay / xaxisopts =(label = ' ') yaxisopts =(label = ' ' linearopts=(viewmin=0)) walldisplay=(fill);
seriesplot x=FOUR_DIGIT_YEAR y= mergedColumn / group= columnDisplay name='a' index=index display=all;
proc sgrender data=combined2 template=multiLineGraph2;
format mergedColumn 4.2 four_digit_year 4.;
02-05-2016 01:59 PM - edited 02-05-2016 01:59 PM
The easiest way is to add a YEAR4. format to your data (You currently are using the 4. format):
format FOUR_DIGIT_YEAR YEAR4.;
If you want to change the template, then go to the doc for the GTL axis options. and look at INTERVAL= option. You can use INTERVAL=YEAR if you are using the template for many data sets and are not sure that they will all have YEAR4 formats.
02-05-2016 02:09 PM
Dan just mentioned a good point: It depends on your data. (Thanks, Dan.) His way is correct if your data are raw numbers like 2000, 2001, 2002. My way assumed that you are using SAS date values, but you probably aren't or else you wouldn't be having this issue.
Need further help from the community? Please ask a new question.