1つのデータセットの中でfunction="text"を何度も使用することは可能ですが、 プログラムがややこしくなってしまいますので、別々のデータセットで作っておいて 後からつなぎ合わせた方が楽かも知れません。 data stocks;
set sashelp.stocks (where=(date >= "01jan2004"d
and date <= "01dec2005"d
and stock = "IBM"));
run;
data anno1;
set stocks;
label=put(date,yymmd.);
if scan(label,2,"-")^="01" then label=scan(label,2,"-");
function="text"; textsize=8;
x1space="datavalue";
y1space="graphpercent";
x1=date; y1=22; anchor="left";
width=100; rotate=-60;
output;
function="line"; linethickness=0.1;
x2space="datavalue";
y2space="graphpercent";
x2=date;
y1=24.5; y2=23;
output;
run;
data anno2;*タイトルのようなもの;
function="text";
textsize=9; textweight="bold";
drawspace="graphpercent";
x1=35; y1=15; label="2004年";
output;
x1=70; label="2005年";
output;
run;
data annotate; set anno1 anno2; run;
proc sgplot data=stocks sganno=annotate;
vbar date / response=volume;
vline date / response=close y2axis;
xaxis display=(novalues noticks);
yaxis offsetmin=0.15;
y2axis offsetmin=0.15;
run;
... View more