Sample 24908: Overlay a plot line on a vertical bar chart
/*************************************************/
/* This example uses the NEEDLE interpolation on */
/* a SYMBOL statement with the WIDTH= option to */
/* simulate a vertical bar chart. */
/*************************************************/
/* Set graphics options */
goptions reset=all cback=white colors=(black) lfactor=2 border;
/* Create input data set, A */
data a;
input month date7. goal actual;
datalines;
01jan96 200 210
01feb96 250 250
01mar96 375 350
01apr96 375 400
01may96 425 410
01jun96 425 475
;
/* Create axis definitions */
axis1 order='01jan96'd to '01jun96'd by month offset=(5) major=none;
axis2 order=0 to 500 by 100 offset=(0,0) minor=none label=(a=-90 r=90);
/* Create symbol definitions */
symbol1 c=blue i=needle v=none w=40;
symbol2 c=red i=j v=dot;
/* Add titles and footnotes */
footnote1 h=1.5 c=black f=simplex 'SALES: Actual ' c=blue f=marker 'U'
c=black f=simplex ' Goal ' c=red '____';
title1 'Sales Report';
title2 'First and Second Qtr. 1996';
/* Produce the plot */
proc gplot data=a;
format month monname3.;
plot actual*month goal*month / overlay haxis=axis1 vaxis=axis2;
run;
quit;

This example uses the NEEDLE interpolation on a SYMBOL statement with the WIDTH= option to simulate a vertical bar chart.
If you have SAS 9, PROC GBARLINE can also be used to produce this type of graph. Please see Sample 24863.
| Type: | Sample |
| Topic: | SAS Reference ==> Procedures ==> GPLOT Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Types ==> Plots ==> Special Plot types
|
| Date Modified: | 2008-01-16 06:31:05 |
| Date Created: | 2004-11-11 11:07:58 |
Operating System and Release Information
| SAS System | SAS/GRAPH | All | n/a | n/a |