-1

This is the code:

proc sgplot data=work.simple pctlevel=group;
  title 'Group Y Portfolio(2007/2008/2009/2010)';
  vbar Companies / group=Year stat=pct seglabel groupdisplay=stack ; 
run; 
proc sgplot data=work.simple pctlevel=group;
  title 'Group Y Portfolio(2007/2008/2009/2010)';
  vbar Companies /  group=Year stat=pct seglabel groupdisplay=cluster ; 
run; 

Please take a look at these 2 charts. How can I combine?image 1

image 2

1 Answers1

0

I think this blog gives you the answer:

Construct a stacked bar chart in SAS where each bar equals 100%

Code from the blog to use as template:

proc freq data=cars order=freq noprint;  /* ORDER= sorts by counts within X */
by Origin;                               /* X var */
tables Type / out=FreqOutSorted;         /* Y var */
run;
 
title "100% Stacked Bar Chart Ordered by Percentages";
proc sgplot data=FreqOutSorted;
vbar Origin / response=Percent group=Type 
              grouporder=data groupdisplay=stack; /* order by counts of 1st bar */
xaxis discreteorder=data;
yaxis grid values=(0 to 100 by 10) label="Percentage of Total with Group";
run;
PeterClemmensen
  • 4,018
  • 3
  • 14
  • 22