From: Robin R High on
Jim,

The annotate capability can be quite flexible for the simple task of=20
adding a vertical line; in the example below x=3D50 with xsys=3D'1' implies=
to=20
start at the middle (50%) of the graph area and x2 from 0 to 80 is the=20
numerical scale for the vertical axis (ysys=3D'2'). You may need to=20
experiment to find the best value for x for the placement of the line to=20
show past versus future. You can also easily change the line type, size,=20
color, with other options.

DATA lne1; RETAIN xsys '1' ysys '2' when 'a'; LENGTH color $8 ;
x=3D50 ; y=3D0 ; function=3D'MOVE'; output;
x=3D50 ; y=3D80 ; function=3D'DRAW'; color=3D'black'; line=3D1; size=3D2; o=
utput;

proc print; run;

proc gchart data=3Dsashelp.class ;
vbar age / discrete sumvar=3Dheight type=3Dmean outside=3Dmean raxis=3Daxis=
1 width
=3D8 annotate=3Dlne1;
run; quit;

Robin High
UNMC







From:
"Lane, Jim" <jim.lane(a)RBC.COM>
To:
SAS-L(a)LISTSERV.UGA.EDU
Date:
09/21/2009 01:00 PM
Subject:
Reference line on PROC GCHART output
Sent by:
"SAS(r) Discussion" <SAS-L(a)LISTSERV.UGA.EDU>



Hi, All

I'm having trouble getting GCHART to co-operate. My program so far looks
like this.=20

axis1 value=3D(h=3D0.5) ;
axis5 value=3D(h=3D0.5) label=3Dnone order=3D('01oct2000'd to '01oct2012'd =
by
qtr);
proc gchart data=3Dwork.c;
vbar month / type=3Dsum sumvar=3Dx subgroup=3Dc axis=3Daxis1 maxis=3Da=
xis5
discrete ;
run; quit;

This is producing a vertical bar chart as I expect. My problem is that I
would like to divide the chart somehow by drawing a vertical reference
line so that the bars for months in the past lie to the left of the line
and the future is to the right. I've tried to do this with options such
as:

href=3D'01sep2009'd lref=3D2 cref=3Dblue

This produces neither a reference line nor an error message. What am I
doing wrong here?

-Jim Lane
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F

This e-mail may be privileged and/or confidential, and the sender does not =

waive any related rights and obligations.
Any distribution, use or copying of this e-mail or the information it=20
contains by other than an intended recipient is unauthorized.
If you received this e-mail in error, please advise me (by return e-mail=20
or otherwise) immediately.=20

Ce courrier =E9lectronique est confidentiel et prot=E9g=E9. L'exp=E9diteur =
ne=20
renonce pas aux droits et obligations qui s'y rapportent.
Toute diffusion, utilisation ou copie de ce message ou des renseignements=20
qu'il contient par une personne autre que le (les) destinataire(s)=20
d=E9sign=E9(s) est interdite.
Si vous recevez ce courrier =E9lectronique par erreur, veuillez m'en aviser=
=20
imm=E9diatement, par retour de courrier =E9lectronique ou par un autre moye=
n.
From: Richard A. DeVenezia on
On Sep 21, 1:58 pm, jim.l...(a)RBC.COM ("Lane, Jim") wrote:
> Hi, All
>
> I'm having trouble getting GCHART to co-operate. My program so far looks
> like this.=20
>
> axis1 value=3D(h=3D0.5)   ;
> axis5 value=3D(h=3D0.5) label=3Dnone order=3D('01oct2000'd to '01oct2012'd =
> by
> qtr);
> proc gchart data=3Dwork.c;
>     vbar month / type=3Dsum  sumvar=3Dx subgroup=3Dc axis=3Daxis1 maxis=3Da=
> xis5
> discrete ;
> run; quit;
>
> This is producing a vertical bar chart as I expect. My problem is that I
> would like to divide the chart somehow by drawing a vertical reference
> line so that the bars for months in the past lie to the left of the line
> and the future is to the right. I've tried to do this with options such
> as:
>
> href=3D'01sep2009'd lref=3D2 cref=3Dblue
>
> This produces neither a reference line nor an error message. What am I
> doing wrong here?
>
> -Jim Lane

It probably has to do 01sep not falling on a QTR start date.

You might get a better visual impact by using annotate to draw an off
color bar for the 'earlier' time period.

The annotate in this sample uses coordinate system '7' to produce a
second bar that visually extends the gray area.

-----------------
goptions reset=all;

data foo;
do date = '01OCT2000'd to '01OCT2012'd;
x = int(10*ranuni(1234));
c = byte (65+5*ranuni(1234));
output;
end;
run;


axis1 value=(h=0.5) ;
axis5 value=(h=0.5) label=none order=('01oct2000'd to '01oct2012'd by
qtr);

%annomac;
data myanno;
%dclanno;
xsys = '1'; x=0;
ysys = '1'; y=0;
function = 'move';
OUTPUT;

xsys = '2'; x='01oct2005'd;
ysys = '1'; y=100;
function = 'bar';

color = 'cxC0C0C0';
style = 'solid';
line = 0;
output;

xsys = '7'; x=0.8;
y = 0;
output;
run;

proc gchart data=work.foo;
format date yyqd.;
vbar date
/ type=sum
sumvar=x
subgroup=c
axis=axis1
maxis=axis5
discrete
anno = myanno
;
run;quit;
-----------------

Richard A. DeVenezia
http://www.devenezia.com
From: Arthur Tabachneck on
Jim,

Yes, SAS doesn't make it as easy to draw a reference line on the other
axis. And, if this is something you have to do to many graphs, annotate
is probably the way to go.

However, if it is a one-off, you can always click on the graph, then click
on edit, and simply draw the desired line.

Art
-------
On Mon, 21 Sep 2009 14:47:09 -0400, Lane, Jim <jim.lane(a)RBC.COM> wrote:

>Art: thanks. Interesting. If I run that as is
>
>
>proc gchart data=a;
> vbar3d YEAR / sumvar=CNT discrete raxis=axis1
> coutline=black cframe=yellow width=5
> vref=30 inside=sum frontref;
>
>I get a reference line. If I change it to something closer to what I'm
after
>
>proc gchart data=a;
> vbar YEAR / sumvar=CNT discrete raxis=axis1
> coutline=black cframe=yellow width=5
> href=1999 inside=sum frontref;
>
>I don't get a reference line, just a warning message:
>
>WARNING: The reference line at 1999 on the vertical axis labeled CNT SUM
is out of range.
>
>How can that be given that YEAR ranges from 1997 to 2001? Also why does
it say "vertical axis" when I asked for a horizontal axis?
>
>/JL
>
>-----Original Message-----
>From: Arthur Tabachneck [mailto:art297(a)NETSCAPE.NET]
>Sent: 2009, September, 21 2:39 PM
>To: SAS-L(a)LISTSERV.UGA.EDU; Lane, Jim
>Subject: Re: Reference line on PROC GCHART output
>
>Jim,
>
>Take a look at the example shown at:
>http://support.sas.com/kb/24/868.html
>
>It describes how to combine vref=somevalue and frontref.
>
>Art
>--------
>On Mon, 21 Sep 2009 13:58:46 -0400, Lane, Jim <jim.lane(a)RBC.COM> wrote:
>
>>Hi, All
>>
>>I'm having trouble getting GCHART to co-operate. My program so far
>>looks like this.
>>
>>axis1 value=(h=0.5) ;
>>axis5 value=(h=0.5) label=none order=('01oct2000'd to '01oct2012'd by
>>qtr); proc gchart data=work.c;
>> vbar month / type=sum sumvar=x subgroup=c axis=axis1 maxis=axis5
>>discrete ; run; quit;
>>
>>This is producing a vertical bar chart as I expect. My problem is that
>>I would like to divide the chart somehow by drawing a vertical
>>reference line so that the bars for months in the past lie to the left
>>of the line and the future is to the right. I've tried to do this with
>>options such
>>as:
>>
>>href='01sep2009'd lref=2 cref=blue
>>
>>This produces neither a reference line nor an error message. What am I
>>doing wrong here?
>>
>>-Jim Lane
>>_______________________________________________________________________
>>
>>This e-mail may be privileged and/or confidential, and the sender does
>not waive any related rights and obligations.
>>Any distribution, use or copying of this e-mail or the information it
>contains by other than an intended recipient is unauthorized.
>>If you received this e-mail in error, please advise me (by return
>>e-mail
>or otherwise) immediately.
>>
>>Ce courrier �lectronique est confidentiel et prot�g�.
>>L'exp�diteur ne
>renonce pas aux droits et obligations qui s'y rapportent.
>>Toute diffusion, utilisation ou copie de ce message ou des
>>renseignements
>qu'il contient par une personne autre que le (les) destinataire(s) d�sign�
>(s) est interdite.
>>Si vous recevez ce courrier �lectronique par erreur, veuillez m'en
>>aviser
>imm�diatement, par retour de courrier �lectronique ou par un autre moyen.
>_______________________________________________________________________
>
>This e-mail may be privileged and/or confidential, and the sender does
not waive any related rights and obligations.
>Any distribution, use or copying of this e-mail or the information it
contains by other than an intended recipient is unauthorized.
>If you received this e-mail in error, please advise me (by return e-mail
or otherwise) immediately.
>
>Ce courrier �lectronique est confidentiel et prot�g�. L'exp�diteur ne
renonce pas aux droits et obligations qui s'y rapportent.
>Toute diffusion, utilisation ou copie de ce message ou des renseignements
qu'il contient par une personne autre que le (les) destinataire(s) d�sign�
(s) est interdite.
>Si vous recevez ce courrier �lectronique par erreur, veuillez m'en aviser
imm�diatement, par retour de courrier �lectronique ou par un autre moyen.
From: "Lane, Jim" on
Hi, Robin
=20
Am I to assume from this that annotate positions things at a fixed location=
relative to the edges of the graph? If so, I don't see how it will help me=
.. I want to draw a reference line over the bar for "this month". Given that=
I can't know in advance where "this month" will fall on the page I would h=
ave to run the graph without the reference line, measure where "this month"=
is this month, then re-program the annotate code and re-draw the reference=
line every month. I guess I could do that but I'd hardly call it simple. F=
or me, simple is href and vref the way they work with GPLOT.=20
=20
Thanks for the example. I've been meaning to get my head around annotate so=
maybe this is as good a time as any,
=20
/JL

________________________________

From: Robin R High [mailto:rhigh(a)unmc.edu]=20
Sent: 2009, September, 21 3:23 PM
To: Lane, Jim
Cc: SAS-L(a)LISTSERV.UGA.EDU
Subject: Re: Reference line on PROC GCHART output



Jim,=20

The annotate capability can be quite flexible for the simple task of adding=
a vertical line; in the example below x=3D50 with xsys=3D'1' implies to st=
art at the middle (50%) of the graph area and x2 from 0 to 80 is the numeri=
cal scale for the vertical axis (ysys=3D'2'). You may need to experiment to=
find the best value for x for the placement of the line to show past versu=
s future. You can also easily change the line type, size, color, with other=
options.=20

DATA lne1; RETAIN xsys '1' ysys '2' when 'a'; LENGTH color $8 ;=20
x=3D50 ; y=3D0 ; function=3D'MOVE'; output;=20
x=3D50 ; y=3D80 ; function=3D'DRAW'; color=3D'black'; line=3D1; size=3D2; o=
utput;=20

proc print; run;=20

proc gchart data=3Dsashelp.class ;=20
vbar age / discrete sumvar=3Dheight type=3Dmean outside=3Dmean raxis=3Daxis=
1 width=3D8 annotate=3Dlne1;=20
run; quit;=20

Robin High=20
UNMC=20







From: "Lane, Jim" <jim.lane(a)RBC.COM>=20
To: SAS-L(a)LISTSERV.UGA.EDU=20
Date: 09/21/2009 01:00 PM=20
Subject: Reference line on PROC GCHART output=20
Sent by: "SAS(r) Discussion" <SAS-L(a)LISTSERV.UGA.EDU>

________________________________




Hi, All

I'm having trouble getting GCHART to co-operate. My program so far looks
like this.=20

axis1 value=3D(h=3D0.5) ;
axis5 value=3D(h=3D0.5) label=3Dnone order=3D('01oct2000'd to '01oct2012'd =
by
qtr);
proc gchart data=3Dwork.c;
vbar month / type=3Dsum sumvar=3Dx subgroup=3Dc axis=3Daxis1 maxis=3Dax=
is5
discrete ;
run; quit;

This is producing a vertical bar chart as I expect. My problem is that I
would like to divide the chart somehow by drawing a vertical reference
line so that the bars for months in the past lie to the left of the line
and the future is to the right. I've tried to do this with options such
as:

href=3D'01sep2009'd lref=3D2 cref=3Dblue

This produces neither a reference line nor an error message. What am I
doing wrong here?

-Jim Lane
_______________________________________________________________________

This e-mail may be privileged and/or confidential, and the sender does not =
waive any related rights and obligations.
Any distribution, use or copying of this e-mail or the information it conta=
ins by other than an intended recipient is unauthorized.
If you received this e-mail in error, please advise me (by return e-mail or=
otherwise) immediately. =20

Ce courrier =E9lectronique est confidentiel et prot=E9g=E9. L'exp=E9diteur =
ne renonce pas aux droits et obligations qui s'y rapportent.
Toute diffusion, utilisation ou copie de ce message ou des renseignements q=
u'il contient par une personne autre que le (les) destinataire(s) d=E9sign=
=E9(s) est interdite.
Si vous recevez ce courrier =E9lectronique par erreur, veuillez m'en aviser=
imm=E9diatement, par retour de courrier =E9lectronique ou par un autre moy=
en.



_______________________________________________________________________

This e-mail may be privileged and/or confidential, and the sender does not =
waive any related rights and obligations.
Any distribution, use or copying of this e-mail or the information it conta=
ins by other than an intended recipient is unauthorized.
If you received this e-mail in error, please advise me (by return e-mail or=
otherwise) immediately. =20

Ce courrier =E9lectronique est confidentiel et prot=E9g=E9. L'exp=E9diteur =
ne renonce pas aux droits et obligations qui s'y rapportent.
Toute diffusion, utilisation ou copie de ce message ou des renseignements q=
u'il contient par une personne autre que le (les) destinataire(s) d=E9sign=
=E9(s) est interdite.
Si vous recevez ce courrier =E9lectronique par erreur, veuillez m'en aviser=
imm=E9diatement, par retour de courrier =E9lectronique ou par un autre moy=
en.
From: "Lane, Jim" on
Hi, Art

The sneaky approach. I love it. Seriously though, I'm producing graphs as PDF files. How do I edit them?

/JL

-----Original Message-----
From: Arthur Tabachneck [mailto:art297(a)NETSCAPE.NET]
Sent: 2009, September, 21 4:09 PM
To: SAS-L(a)LISTSERV.UGA.EDU; Lane, Jim
Subject: Re: Reference line on PROC GCHART output

Jim,

Yes, SAS doesn't make it as easy to draw a reference line on the other axis. And, if this is something you have to do to many graphs, annotate is probably the way to go.

However, if it is a one-off, you can always click on the graph, then click on edit, and simply draw the desired line.

Art
-------
On Mon, 21 Sep 2009 14:47:09 -0400, Lane, Jim <jim.lane(a)RBC.COM> wrote:

>Art: thanks. Interesting. If I run that as is
>
>
>proc gchart data=a;
> vbar3d YEAR / sumvar=CNT discrete raxis=axis1
> coutline=black cframe=yellow width=5
> vref=30 inside=sum frontref;
>
>I get a reference line. If I change it to something closer to what I'm
after
>
>proc gchart data=a;
> vbar YEAR / sumvar=CNT discrete raxis=axis1
> coutline=black cframe=yellow width=5
> href=1999 inside=sum frontref;
>
>I don't get a reference line, just a warning message:
>
>WARNING: The reference line at 1999 on the vertical axis labeled CNT
>SUM
is out of range.
>
>How can that be given that YEAR ranges from 1997 to 2001? Also why does
it say "vertical axis" when I asked for a horizontal axis?
>
>/JL
>
>-----Original Message-----
>From: Arthur Tabachneck [mailto:art297(a)NETSCAPE.NET]
>Sent: 2009, September, 21 2:39 PM
>To: SAS-L(a)LISTSERV.UGA.EDU; Lane, Jim
>Subject: Re: Reference line on PROC GCHART output
>
>Jim,
>
>Take a look at the example shown at:
>http://support.sas.com/kb/24/868.html
>
>It describes how to combine vref=somevalue and frontref.
>
>Art
>--------
>On Mon, 21 Sep 2009 13:58:46 -0400, Lane, Jim <jim.lane(a)RBC.COM> wrote:
>
>>Hi, All
>>
>>I'm having trouble getting GCHART to co-operate. My program so far
>>looks like this.
>>
>>axis1 value=(h=0.5) ;
>>axis5 value=(h=0.5) label=none order=('01oct2000'd to '01oct2012'd by
>>qtr); proc gchart data=work.c;
>> vbar month / type=sum sumvar=x subgroup=c axis=axis1 maxis=axis5
>>discrete ; run; quit;
>>
>>This is producing a vertical bar chart as I expect. My problem is that
>>I would like to divide the chart somehow by drawing a vertical
>>reference line so that the bars for months in the past lie to the left
>>of the line and the future is to the right. I've tried to do this with
>>options such
>>as:
>>
>>href='01sep2009'd lref=2 cref=blue
>>
>>This produces neither a reference line nor an error message. What am I
>>doing wrong here?
>>
>>-Jim Lane
>>______________________________________________________________________
>>_
>>
>>This e-mail may be privileged and/or confidential, and the sender does
>not waive any related rights and obligations.
>>Any distribution, use or copying of this e-mail or the information it
>contains by other than an intended recipient is unauthorized.
>>If you received this e-mail in error, please advise me (by return
>>e-mail
>or otherwise) immediately.
>>
>>Ce courrier �lectronique est confidentiel et prot�g�.
>>L'exp�diteur ne
>renonce pas aux droits et obligations qui s'y rapportent.
>>Toute diffusion, utilisation ou copie de ce message ou des
>>renseignements
>qu'il contient par une personne autre que le (les) destinataire(s)
>d�sign�
>(s) est interdite.
>>Si vous recevez ce courrier �lectronique par erreur, veuillez m'en
>>aviser
>imm�diatement, par retour de courrier �lectronique ou par un autre moyen.
>_______________________________________________________________________
>
>This e-mail may be privileged and/or confidential, and the sender does
not waive any related rights and obligations.
>Any distribution, use or copying of this e-mail or the information it
contains by other than an intended recipient is unauthorized.
>If you received this e-mail in error, please advise me (by return
>e-mail
or otherwise) immediately.
>
>Ce courrier �lectronique est confidentiel et prot�g�.
>L'exp�diteur ne
renonce pas aux droits et obligations qui s'y rapportent.
>Toute diffusion, utilisation ou copie de ce message ou des
>renseignements
qu'il contient par une personne autre que le (les) destinataire(s) d�sign�
(s) est interdite.
>Si vous recevez ce courrier �lectronique par erreur, veuillez m'en
>aviser
imm�diatement, par retour de courrier �lectronique ou par un autre moyen.
_______________________________________________________________________

This e-mail may be privileged and/or confidential, and the sender does not waive any related rights and obligations.
Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized.
If you received this e-mail in error, please advise me (by return e-mail or otherwise) immediately.

Ce courrier �lectronique est confidentiel et prot�g�. L'exp�diteur ne renonce pas aux droits et obligations qui s'y rapportent.
Toute diffusion, utilisation ou copie de ce message ou des renseignements qu'il contient par une personne autre que le (les) destinataire(s) d�sign�(s) est interdite.
Si vous recevez ce courrier �lectronique par erreur, veuillez m'en aviser imm�diatement, par retour de courrier �lectronique ou par un autre moyen.