Hi,
I'm new in SAS/GRAPH facility so I need small help with simple SAS graph:
DATA:
Date: Time:
05.02.2013 10:01:29
14.02.2013 11:02:01
25.02.2013 10:10:16
03.03.2013 10:24:08
18.03.2013 9:27:40
18.03.2013 9:56:19
18.03.2013 12:18:50
01.04.2013 11:02:41
SAS code:
symbol1 ci=Blue c=Red i=join v=dot l=1 w=2;
proc gplot data=&InTable;
plot startTime*startDate=1/ AUTOHREF AUTOVREF;
run;
Result Graph in attached image.
So what I need is just mark last Graph node in Bold(or in another color etc.) else I'd like automatically add some label to this last Graph node , this label will have concattenated Date and Time value:"01.04.2013 11:02:41"
Thanks!
hi.
the simplest way I know is to use a small annotate data set.
First you need to sort your data by startDate;
proc sort data = have;by startDate;run;
Then create the annotate data set, where you say if it is the last date then change the color:
data annotate;
length function color $8 text $20;
retain xsys ysys '2' when 'a';
set have end = _last_;
by startDate;
function='symbol';
xc = startDate
y = startTime;
size=1.3;
text='dot';
color = 'blue';
/* The symbol color is determined by the value of a variable. */
if (_last_) then do;
color='green'; size = 2;
end;
output;
run;
symbol1 ci=Blue c=Red i=join v=dot l=1 w=2;
proc gplot data= have;
plot starttime*startDate=1/ AUTOHREF AUTOVREF anno = annotate;
run;quit;
Good luck!
Anca.
hi.
the simplest way I know is to use a small annotate data set.
First you need to sort your data by startDate;
proc sort data = have;by startDate;run;
Then create the annotate data set, where you say if it is the last date then change the color:
data annotate;
length function color $8 text $20;
retain xsys ysys '2' when 'a';
set have end = _last_;
by startDate;
function='symbol';
xc = startDate
y = startTime;
size=1.3;
text='dot';
color = 'blue';
/* The symbol color is determined by the value of a variable. */
if (_last_) then do;
color='green'; size = 2;
end;
output;
run;
symbol1 ci=Blue c=Red i=join v=dot l=1 w=2;
proc gplot data= have;
plot starttime*startDate=1/ AUTOHREF AUTOVREF anno = annotate;
run;quit;
Good luck!
Anca.
Hi Anca,
It's exactly what I need, thanks!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.