|
Here is a solution. It is quite similar one.
data tmp;
label Fordsales='Sale by Year';
do year=1984 to 2004 by 2;
Fordsales=18+(year-1984)*2 + 10*rannor(123);
if year in (1984,2004) then fdl=put(Fordsales, 8.1);
else fdl=' ';
Chryslersales=12+(year-1984)*2 + 10*rannor(123);
if year in (1984,2004) then cdl=put(Chryslersales, 8.1);
else cdl=' ';
output;
end;
title 'Example';
proc sgplot data=tmp;
series x=year y=Fordsales/CURVELABEL = "Ford sales" DATALABEL=fdl CURVELABELPOS= END
CURVELABELLOC=OUTSIDE;
series x=year y=Chryslersales/CURVELABEL = "Chrysler sales"
DATALABEL=cdl CURVELABELPOS= END CURVELABELLOC=OUTSIDE;
XAXIS TYPE = DISCRETE GRID;
YAXIS GRID;
INSET 'Sales by year-Ford vs. Chrysler'/ POSITION = TOPLEFT ;
run;
|