FOCUS AREAS

Graphics

Bar Chart with Line Overlay
Bar Line Chart
Base SAS: ODS Graphics Procedures: SGPLOT

data barline;
  input Year Desk Chair Sofa Lamp Table;
  format Desk Chair Sofa Lamp Table dollar.;
  datalines;
2008  20000  15000  12000  3000  11000
2009  21000  16000  14000  4000  12000
2010  22000  16500  14500  4200  12500
2011  21000  15500  13500  3500  11700
2012  20000  15000  13000  2500  12000
;
/* Open the LISTING destination and assign the LISTING style to the graph */ 
ods listing style=listing;
ods graphics / width=5in height=2.81in;

title 'Sales by Product and Year';
proc sgplot data=barline;
  vbar year / response=desk stat=sum dataskin=sheen nostatlabel name='a';
  vline year / response=chair stat=sum lineattrs=(thickness=9 pattern=solid) nostatlabel curvelabel;
  vline year / response=sofa  stat=sum lineattrs=(thickness=9 pattern=solid) nostatlabel curvelabel;
  vline year / response=lamp  stat=sum lineattrs=(thickness=9 pattern=solid) nostatlabel curvelabel;
  vline year / response=table stat=sum lineattrs=(thickness=9 pattern=solid) nostatlabel curvelabel;
  keylegend 'a' / location=inside position=topright;
  xaxis display=(nolabel);
  yaxis grid offsetmin=0 display=(nolabel);
run;