From: Richard A. DeVenezia on
On Mar 4, 2:22 pm, procconte...(a)GMAIL.COM (SAS_learner) wrote:
> For a graph Change from Base line I need to put a number  close to the bar
> which shows the number of days from baseline to the best response. To put
> them I am doing something like this. I do not like this solution at all as
> this is hardcoding the vales for Cpn. I tried to generalize my approach in
> the part2 I am getting values close to not way I want . Is there a better to
> do it . If I am adjusting the values for Cpn the txt values at end of bars
> are spreading all over the place.

Learner:

It looks like you are going through alot of work to do something that
can be done in a simpler fashion.

Since you don't show the GCHART statements, the following is a best
guess demonstration of using annotate to display the value of a
'satellite variable' above the bars of a VBAR chart.
Note the use of the XC annotate variable - this ensures alignment with
the bar centers.

----------
data foo;
do _n_ = 1 to 20;
patientid = 'pat-' || put(_n_,z3.);
prtdiff = 20*ranuni(12345);
dd = 10 + floor(20*ranuni(12345));
output;
end;
run;

ods listing;

%annomac;

options nomprint;

data anno;
%DclAnno;
set foo;
xsys = '2';
ysys = '2';

xc = patientid;
y = prtdiff;

position = '2';
function = 'label';

length text $10;
text = cats(dd);
run;

proc gchart data=foo anno=anno;
vbar patientid
/ sumvar = prtdiff
width = 6
;
run;
----------