/*--Replace blank x axis values in the data with "Miss1" and "Miss2"--*/ proc import datafile='C:\StackedBarLineData2.xls' dbms=XLS out=StackedBarLine replace; run; /*--Reshape data to grouped case--*/ data groupedData; keep xaxis Group BarValue LineValue url; label barvalue='Count of Something'; label linevalue='% of Something'; set StackedBarLine; xaxis=translate(xaxis, 'A0'x, '.'); Group='A'; BarValue=group_a_count; LineValue=Group_a_Fr__; url='http://www.sas.com'; output; Group='B'; BarValue=group_b_count; LineValue=Group_b_Fr__; url='http://www.sas.com'; output; Group='C'; BarValue=group_c_count; LineValue=Group_c_Fr__; url='http://www.sas.com'; output; run; %let gpath='C:\'; %let dpi=100; ods listing gpath=&gpath image_dpi=&dpi; ods html close; /*ods html;*/ ods graphics / reset imagemap=on width=6in height=3in imagename='StackedBarLine_SG'; title 'Stacked Grouped BarLine Chart'; proc sgplot data=groupedData; format linevalue percent.; vbar xaxis / response=BarValue group=Group url=url; vline xaxis / response=LineValue group=Group missing y2axis break markers markerattrs=(symbol=circlefilled size=9) lineattrs=(pattern=solid thickness=2); xaxis display=(noticks nolabel) discreteorder=data; yaxis offsetmin=0 values=(0 to 14000 by 2000) grid; y2axis offsetmin=0 values=(0 to 0.07 by 0.01); run; /*ods html close;*/