I have a ReferenceLine statement within a layout prototype that is within a layout DataLattice. The CurveLabel prints several times across the graph, once for every change in the ColumnVar variable value. Is there a way to get the CurveLabel to print only once, say for either the maximum or minimum value of ColumnVar?
If I'm understanding this scenario correctly, you should be able to duplicate the ColumnVar column, put missing values where you do not want values displayed, and point the ReferenceLine statement at column. Let me know if that works for you.
Reference lines can specified directly (as in your case) or by a column. The column-driven technique enables you to create different reference lines in each cell. You can use the same techinque to control your labels. First, add your reference value and one label to your data. Here is one way to do it:
[pre]
proc sort data=sashelp.class out=temp; by sex; run;
data withref;
set temp;
by sex;
if first.sex then do;
refval = 3.7;
if (_n_ = 1) then reflabel="mylabel";
else reflabel=.;
end;
else do;
refval=.;
reflabel=.;
end;
run;
[/pre]
Then, change your REFERENCELINE statement to point to those columns:
Thank you very much Dan. That solution was so easy I'm embarrassed that I even had to ask. I need to read the documentation more closely.
The 2025 SAS Hackathon Kicks Off on June 11!
Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.