The sample code on the Full Code tab illustrates how to use an Annotate data set to draw a right vertical axis on a graph generated with PROC GCHART.
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 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 htitle=12pt htext=10pt;
/* Create sample data */
data sample;
do mid=1 to 5;
resp=ranuni(0)*4000;
output;
end;
run;
/* Create an annotate data set to draw a right vertical axis */
data anno;
length function color $8;
retain color 'black' when 'a';
do i=0 to 4000 by 1000;
/* Draw the tick marks */
function='move';
xsys='1'; ysys='2';
x=100; y=i;
output;
function='draw'; xsys='A'; ysys='A';
x=+1; y=+0;
line=1;
output;
/* Draw the tick mark values */
function='cntl2txt'; output;
function='label'; xsys='A'; ysys='A';
x=+1; y=+.25;
text=trim(left(put(i/4000,percent8.0)));
position='6';
output;
end;
run;
pattern1 value=solid color=vibg;
axis1 order=(0 to 4000 by 1000);
title1 'Bar Chart with Right Vertical Axis';
proc gchart data=sample;
vbar mid / discrete sumvar=resp width=10
inside=sum raxis=axis1 annotate=anno;
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.
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-10 15:26:07 |
Date Created: | 2010-12-28 01:38:44 |
Product Family | Product | Host | SAS Release | |
Starting | Ending | |||
SAS System | SAS/GRAPH | 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 |