Sample 24863: Overlay a plot line on a vertical bar chart using PROC GBARLINE
The GBARLINE procedure produces bar line charts. Bar line charts are vertical bar charts with a plot overlay. These charts graphically represent the value of a statistic calculated for one or more variables in an input SAS data set. The chart variables can be either numeric or character.
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 code uses the GBARLINE procedure to produce a bar chart overlaid with a line plot.
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;
data nyse;
informat day date9.;
format day date5.;
input day $ high low close volume;
volume=volume/1000;
datalines;
02AUG2002 10478.76 10346.24 10426.91 1908809
03AUG2002 11042.92 10298.44 10274.65 1807543
04AUG2002 10498.22 10400.31 10456.43 1500656
05AUG2002 10694.47 10636.32 10762.98 1498403
;
run;
symbol1 i=join v=dot c=black h=1.5;
title1 "NYSE Closing Price and Volume By Day";
axis1 minor=none order=(0 to 2000 by 250);
axis2 minor=none;
proc gbarline data=nyse;
bar day / sumvar=volume discrete patternid=midpoint
width=10 raxis=axis1;
plot / sumvar=close axis=axis2;
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.
The GBARLINE procedure produces bar line charts. Bar line charts are vertical bar charts with a plot overlay. These charts graphically represent the value of a statistic calculated for one or more variables in an input SAS data set. The chart variables can be either numeric or character.
Type: | Sample |
Topic: | SAS Reference ==> Procedures ==> GBARLINE
|
Date Modified: | 2005-08-24 16:06:24 |
Date Created: | 2004-11-11 11:07:52 |
Operating System and Release Information
SAS System | SAS/GRAPH | All | 9.1 TS1M0 | n/a |