BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I want to make a bar line chart with two bars. Does anybody know if Proc Gbarline can manage this?
It seems like Proc Gbarline can make these kind of charts with only one bar.

Thanx for help.
3 REPLIES 3
David_SAS
SAS Employee
A SAS/GRAPH expert in Technical Support told me:

For the most part, the number of bars produced by PROC GBARLINE depends upon your input data and the value of the LEVELS= option on the BAR statement of PROC GBARLINE. The following code demonstrates how to produce output from PROC GBARLINE that has 5 bars:
[pre]
Goptions
Reset = All
Device = WIN
Cback = Beige
;

data nyse;

informat DAY date9.;
format DAY date5.;

input DAY $ HIGH LOW CLOSE VOLUME;

volume = volume/1000;

cards;
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
06AUG2002 10801.12 10695.13 10759.48 1695602
;
run;

title1 h=2 f='Arial/bo' "NYSE Closing Price and Volume By Day";
footnote h=1.5 f='Arial/bo' "Release is &sysvlong";

symbol1 f=marker v=U c=green h=1;
pattern1 v=solid c=libg;

proc gbarline data=nyse;

bar day / sumvar=volume levels=5;

plot / sumvar=close;
run;
quit;
[/pre]

-- David Kelley, SAS
Olivier
Pyrite | Level 9
I am not sure to understand your problem properly :
- does your GBARLINE proc only produce ONE and only one bar (then the previous answer should fix ; you can either use the DISCRETE option in the BAR statement to get one bar per value) ;
- or do you want two SERIES of bars on the same graph, in an overlayed kind of graph ?
deleted_user
Not applicable
What I want is two series of bars (your second option). I'll be glad if there is a solution to that problem.

Thanx for help!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 694 views
  • 0 likes
  • 3 in conversation