FOCUS AREAS

Graphics

stacked vertical bar chart
Base SAS: ODS Graphics Procedure: SGPLOT

/* This program requires SAS 9.4 TS Level 1M2 or later */
%let gpath='.';
%let dpi=100;

data cars;
  set sashelp.cars(where=(type ne 'Hybrid'));
run;

ods html close;

/*--VBar Stacked--*/
ods listing gpath=&gpath image_dpi=&dpi style=analysis;
ods graphics / reset width=5in height=3.75in imagename='VBar_Segment_Labels';
title 'Frequencies by Origin and Type';
footnote j=l 'Segment and Bar Labels';
proc sgplot data=cars nowall noborder;
  vbar type / group=origin dataskin=pressed 
    groupdisplay=stack seglabel seglabelfitpolicy=none 
    seglabelattrs=(size=5 weight=bold) baselineattrs=(thickness=0) 
    datalabel datalabelattrs=(color=maroon weight=bold);
  keylegend / title='' location=inside position=topright across=1;
  xaxis display=(nolabel);
  yaxis grid display=(noline noticks) offsetmin=0;
  run;

title;
footnote;