Date: Fri, 15 Oct 2010 11:53:04 -0400
Reply-To: Ya Huang <ya.huang@AMYLIN.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Ya Huang <ya.huang@AMYLIN.COM>
Subject: sgplot/vbar how to put statistics outside the bar?
Is there a simple way to put statistics outside the bar (on top)?
It is very simple for gchart/vbar, but not as obvious in sgplot/vbar.
The way I can think of is to use vline statement for the statistics,
since vline has a datalabel option. For that I have to suppress the line
by using thikness=0. But still the result is not perfect, depends on
the data, sometimes the datalabel will be under the line, or pushed
into the bar. I can add a delta to the variable, but not robust way.
Any better idea?
trt=1; val=23; output;
trt=2; val=14; output;
trt=3; val=34; output;
ods html file="c:\temp\junk.html" gpath="c:\temp";
ods graphics on;
proc sgplot data=xx;
vbar trt / response=val group=trt;
vline trt / response=datalb datalabel;* LINEATTRS=(THICKNESS=0);
ods html close;