Sample 42513: Draw tick marks at each midpoint on a vertical bar chart
This sample illustrates how to use an Annotate data set to draw tick marks at each midpoint on a vertical bar chart generated by 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.
This sample illustrates how to use an Annotate data set to draw tick marks at each midpoint on a vertical bar chart generated by the GCHART procedure.
The graphics output in the Results tab was produced using SAS® 9.2. Submitting the sample code with releases of SAS prior to SAS 9.2 might produce different results.
/* Set the graphics environment. */
goptions reset=all cback=white border htext=10pt htitle=12pt;
/* Create sample data */
proc sort data=sashelp.class out=class;
by age;
run;
/* Create an annotate data set to draw */
/* tick marks at each midpoint. */
data annoticks;
length function color $ 8;
retain color 'black' when 'a' xsys '2';
set class;
by age;
if first.age then do;
function='move';
ysys='1';
midpoint=age;
y=0;
output;
function='draw';
ysys='a'; /* relative coordinate system */
midpoint=age;
y=-.75;
line=1;
size=1;
output;
end;
run;
/* Generate the graph */
proc gchart data=class;
vbar age / sumvar=height discrete width=10 annotate=annoticks
maxis=axis1 raxis=axis2;
axis1 label=('Age');
axis2 label=(angle=90 'Height');
title1 'Draw Tick Marks at Each Midpoint';
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 illustrates how to use an Annotate data set to draw tick marks at each midpoint on a vertical bar chart generated by the GCHART procedure.
Type: | Sample |
Topic: | SAS Reference ==> Procedures ==> GCHART Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Elements ==> Annotation Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Types ==> Charts ==> Bar
|
Date Modified: | 2011-02-24 13:43:45 |
Date Created: | 2011-02-24 13:21:47 |
Operating System and Release Information
SAS System | SAS/GRAPH | z/OS | 9.1 TS1M0 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.1 TS1M0 | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.1 TS1M0 | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.1 TS1M0 | |
Microsoft Windows 2000 Advanced Server | 9.1 TS1M0 | |
Microsoft Windows 2000 Datacenter Server | 9.1 TS1M0 | |
Microsoft Windows 2000 Server | 9.1 TS1M0 | |
Microsoft Windows 2000 Professional | 9.1 TS1M0 | |
Microsoft Windows NT Workstation | 9.1 TS1M0 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.1 TS1M0 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.1 TS1M0 | |
Microsoft Windows Server 2003 Standard Edition | 9.1 TS1M0 | |
Microsoft Windows XP Professional | 9.1 TS1M0 | |
64-bit Enabled AIX | 9.1 TS1M0 | |
64-bit Enabled HP-UX | 9.1 TS1M0 | |
64-bit Enabled Solaris | 9.1 TS1M0 | |
HP-UX IPF | 9.1 TS1M0 | |
Linux | 9.1 TS1M0 | |
OpenVMS Alpha | 9.1 TS1M0 | |
Tru64 UNIX | 9.1 TS1M0 | |