Vertical stack bars and plot

Reply
Frequent Contributor
Posts: 129

Vertical stack bars and plot

Hi,

is there a way to create vertical stack bars and a plot line in one graph, I know vertical bars and plot line is possible but never tried it with the stack bars

Thanks

Super User
Posts: 17,786

Re: Vertical stack bars and plot

Here's a way too complicated example, but in general robslink.com is the best source for graph code to start off with:

http://www.robslink.com/SAS/democd11/oilbar_info.htm

SAS Employee
Posts: 967

Re: Vertical stack bars and plot

SAS Employee
Posts: 967

Re: Vertical stack bars and plot

Or, if you have SAS 9.2 or higher, you can use Proc Gbarline (rather than annotating the line & right-hand axis)...

axis1 value=(angle=90);

proc gbarline data=sashelp.shoes;
   bar region / sumvar=sales subgroup=product maxis=axis1;
   plot / sumvar=returns;
run;

Contributor
Posts: 34

Re: Vertical stack bars and plot

By far the easiest solution would be to use proc sgplot.

R

SAS Employee
Posts: 967

Re: Vertical stack bars and plot

Sticky - do you have some code to demonstrate that?

I'm curious if it is simpler than the gbarline code I posted Smiley Happy

Contributor
Posts: 34

Re: Vertical stack bars and plot

Looks like gbarline is the easiest way to go. To get this in SG requires coding it in GTL which makes it way too complex in comparison.

R

Ask a Question
Discussion stats
  • 6 replies
  • 408 views
  • 0 likes
  • 4 in conversation