%let gpath=C:\;
%let dpi=200;
ods html close;
ods listing style=HTMLBlue gpath="&gpath" image_dpi=&dpi;
/*-_Clock face data--*/
data clock;
length pos $12;
pi=constant("pi");
zero=0;
a=100;
do i=1 to 12;
angle=90-i*30;
angle2=ifn((i ge 4 and i le 8),angle+90,angle-90);
x=a*cos(angle*pi/180);
y=a*sin(angle*pi/180);
size=floor(10*(1+ranuni(2)));
if i=12 then size=20;
select (i);
when (1, 2) pos='TOPRIGHT';
when (3) pos='RIGHT';
when (4, 5) pos='BOTTOMRIGHT';
when (6) pos='BOTTOM';
when (7, 8) pos='BOTTOMLEFT';
when (9) pos='LEFT';
when (10, 11) pos='TOPLEFT';
when (12) pos='TOP';
otherwise;
end;
output;
end;
run;
ods html;
proc print; run;
ods html close;
title;
/*--Modify Clock data--*/
data clock2;
set clock;
select (i);
when (3, 9) pos='TOP'; /*TOP*/
otherwise;
end;
run;
/*--Clock--*/
ods graphics / reset width=4in height=4in imagename='Clock' ;
proc sgplot data=clock2 noborder aspect=1 noautolegend;
text x=x y=y text=i / rotate=angle2 textattrs=(size=16) strip position=pos;
ellipseparm semimajor=100 semiminor=100 / fill outline lineattrs=(thickness=3);
xaxis display=none min=-101 max=101;
yaxis display=none min=-101 max=101;
run;
/*--Clock with variable text size--*/
ods graphics / reset width=4in height=4in imagename='Clock_Size' ;
proc sgplot data=clock2 noborder aspect=1 noautolegend;
text x=x y=y text=i / rotate=angle2 textattrs=(size=14) strip position=pos
sizeresponse=size sizemin=6 sizemax=30 sizemaxresponse=20;
ellipseparm semimajor=100 semiminor=100 / fill outline lineattrs=(thickness=3);
xaxis display=none min=-101 max=101;
yaxis display=none min=-101 max=101;
run;