Hello
Is it possible to label only the end point on each series plotted on the y axis. I have the below and would like only the end point for the previous months and then only the end/most current point labeled on the current month. Thank you.
PROC TEMPLATE;
DEFINE STATGRAPH LateLoanCt;
begingraph / subpixel=on;
entrytitle 'Total FM Late Loan Units';
layout overlay / xaxisopts=(display=(ticks tickvalues))
yaxisopts=(griddisplay=off display=(ticks tickvalues));
SERIESPLOT X=Pipe_BusinessDayofMonth Y=MTD_Late / LINEATTRS=(COLOR=GREEN PATTERN=SOLID) LEGENDLABEL='MTD' name='a';
SERIESPLOT X=Pipe_BusinessDayofMonth Y=MO1_Late / LINEATTRS=(COLOR=GREY PATTERN=SOLID) LEGENDLABEL="&PREVMOE" name='b';
SERIESPLOT X=Pipe_BusinessDayofMonth Y=MO2_Late / LINEATTRS=(COLOR=BLUE PATTERN=SOLID) LEGENDLABEL="&PREVMOE2" name='c';
SERIESPLOT X=Pipe_BusinessDayofMonth Y=MO3_Late / LINEATTRS=(COLOR=RED PATTERN=SOLID) LEGENDLABEL="&PREVMOE3" name='d';
discretelegend 'a' 'b' 'c' 'd'/ location=outside halign=center valign=bottom;
endlayout;
endgraph;
end;
run;
PROC SGRENDER DATA=WORK.ALLUPLATE1 TEMPLATE=LateLoanCt;
RUN;
Here are a couple of ways you could do it:
1. For each Y variable, copy the last value of the variable into its own variable (e.g. M01_Late_Last, M02_Late_Last, etc.). Then, use DATALABEL=<your variable> on each SERIES plot to reference each column. That will label only the last point.
2. Seeing that you are using macro variables, you could also stick these values in macro variables and use the CURVELABEL option on each SERIES plot to label the end of the line( e.g. CURVELABEL="&M01_Late_Last").
Hope this helps!
Dan
Here are a couple of ways you could do it:
1. For each Y variable, copy the last value of the variable into its own variable (e.g. M01_Late_Last, M02_Late_Last, etc.). Then, use DATALABEL=<your variable> on each SERIES plot to reference each column. That will label only the last point.
2. Seeing that you are using macro variables, you could also stick these values in macro variables and use the CURVELABEL option on each SERIES plot to label the end of the line( e.g. CURVELABEL="&M01_Late_Last").
Hope this helps!
Dan
Once again thank you very much!!
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.