Sample 43864: Draw a vertical line at a selected midpoint with PROC GCHART
The sample code on the
Full Code tab uses the Annotate facility to place a vertical line at a selected midpoint on a bar chart generated with the GCHART procedure.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
The code below uses the Annotate facility to place a vertical line at a selected midpoint on a bar chart generated with the GCHART procedure.
/* Set the graphics environment */
goptions reset=all border cback=white htitle=12pt htext=10pt;
/* Create a sample data set */
data test;
do mid=-2.5 to 2.5 by .5;
yvar=ranuni(10) * 5 ;
output;
end;
run;
/* Create an annotate data set to draw the vertical line */
data lines ;
length function style color $8;
function='move'; xsys='2'; ysys='1'; midpoint=0.0; y=0; output;
function='draw'; xsys='2'; ysys='1'; when='a'; color='black'; midpoint=0.0; y=100;
style='swiss'; line=2; output;
run;
/* Create the graph */
title1 "Annotate a Vertical Line at a Selected Midpoint";
proc gchart data=test;
vbar mid / discrete sumvar=yvar patternid=midpoint space=3 width=6 annotate=lines;
pattern1 value=solid;
run;
quit;
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
This sample uses the Annotate facility to place a vertical line at a selected midpoint on a bar chart generated with the GCHART procedure.
Type: | Sample |
Topic: | Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Elements ==> Annotation SAS Reference ==> Procedures ==> GCHART Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Types ==> Charts ==> Bar
|
Date Modified: | 2012-07-27 14:23:57 |
Date Created: | 2011-07-29 15:11:50 |
Operating System and Release Information
SAS System | SAS/GRAPH | 64-bit Enabled Solaris | 9.2 TS2M3 | |
64-bit Enabled HP-UX | 9.2 TS2M3 | |
64-bit Enabled AIX | 9.2 TS2M3 | |
Windows Vista for x64 | 9.2 TS2M3 | |
Windows Vista | 9.2 TS2M3 | |
Windows 7 Ultimate x64 | 9.2 TS2M3 | |
Windows 7 Ultimate 32 bit | 9.2 TS2M3 | |
Windows 7 Professional x64 | 9.2 TS2M3 | |
Windows 7 Professional 32 bit | 9.2 TS2M3 | |
Windows 7 Home Premium x64 | 9.2 TS2M3 | |
Windows 7 Home Premium 32 bit | 9.2 TS2M3 | |
Windows 7 Enterprise x64 | 9.2 TS2M3 | |
Windows 7 Enterprise 32 bit | 9.2 TS2M3 | |
Microsoft Windows XP Professional | 9.2 TS2M3 | |
Microsoft Windows Server 2008 for x64 | 9.2 TS2M3 | |
Microsoft Windows Server 2008 R2 | 9.2 TS2M3 | |
Microsoft Windows Server 2008 | 9.2 TS2M3 | |
Microsoft Windows Server 2003 for x64 | 9.2 TS2M3 | |
Microsoft Windows Server 2003 Standard Edition | 9.2 TS2M3 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.2 TS2M3 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.2 TS2M3 | |
Microsoft® Windows® for x64 | 9.2 TS2M3 | |
Microsoft Windows XP 64-bit Edition | 9.2 TS2M3 | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.2 TS2M3 | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.2 TS2M3 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.2 TS2M3 | |
z/OS 64-bit | 9.2 TS2M3 | |
z/OS | 9.2 TS2M3 | |
HP-UX IPF | 9.2 TS2M3 | |
Linux | 9.2 TS2M3 | |
Linux for x64 | 9.2 TS2M3 | |
Linux on Itanium | 9.2 TS2M3 | |
OpenVMS Alpha | 9.2 TS2M3 | |
OpenVMS on HP Integrity | 9.2 TS2M3 | |
Solaris for x64 | 9.2 TS2M3 | |
Tru64 UNIX | 9.2 TS2M3 | |