BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
BLarson
Obsidian | Level 7

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;

1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

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

View solution in original post

2 REPLIES 2
DanH_sas
SAS Super FREQ

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

BLarson
Obsidian | Level 7

Once again thank you very much!!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

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