%let gpath='.';
ods html close;
%let w=4in;
%let dpi=200;
ods listing gpath=&gpath image_dpi=&dpi;
/*--Freq VBar--*/
ods listing image_dpi=200;
ods graphics / reset width=&w height=3in imagename='BarChartFreq';
title 'Counts by Type';
proc sgplot data=sashelp.cars;
vbar type;
run;
title;
/*--Response VBar--*/
ods graphics / reset width=&w height=3in imagename='BarChartResp';
title 'Mileage by Type';
proc sgplot data=sashelp.cars;
vbar type / response=mpg_city stat=mean
barwidth=0.6 fillattrs=graphdata2;
xaxis display=(nolabel);
run;
title;
/*--Response VBar Error--*/
ods graphics / reset width=&w height=3in imagename='BarChartRespError';
title 'Mileage by Type';
proc sgplot data=sashelp.cars;
vbar type / response=mpg_city stat=mean
barwidth=0.6
fillattrs=graphdata4 limits=both
baselineattrs=(thickness=0);
xaxis display=(nolabel);
run;
title;
/*--Response Label VBar--*/
%let softgreen=cx8faf7f;
ods graphics / reset width=&w height=3in imagename='BarChartRespLabel';
title 'Mileage by Type';
proc sgplot data=sashelp.cars noborder;
format mpg_city 4.1;
vbar type / response=mpg_city stat=mean
datalabel dataskin=matte
baselineattrs=(thickness=0)
fillattrs=(color=&softgreen);
xaxis display=(nolabel noline noticks);
yaxis display=(noline noticks) grid;
run;
title;
/*--Response Stack VBar--*/
ods graphics / reset width=&w height=3in imagename='BarChartStack';
title 'Sales by Type and Quarter for 1994';
proc sgplot data=sashelp.prdsale(where=(year=1994)) noborder;
format actual dollar8.0;
vbar product / response=actual stat=sum
group=quarter seglabel datalabel
baselineattrs=(thickness=0)
outlineattrs=(color=cx3f3f3f);
xaxis display=(nolabel noline noticks);
yaxis display=(noline noticks) grid;
run;
title;
/*--Response Cluster VBar--*/
ods graphics / reset width=&w height=3in imagename='BarChartCluster';
title 'Sales by Type and Year';
proc sgplot data=sashelp.prdsale noborder;
vbar product / response=actual stat=sum
group=year groupdisplay=cluster
dataskin=pressed
baselineattrs=(thickness=0);
xaxis display=(nolabel noline noticks);
yaxis display=(noline) grid;
run;
/*--Response Cluster Gradient VBar--*/
ods graphics / reset width=&w height=3in imagename='BarChartClusterGradient';
title 'Sales by Type and Year';
proc sgplot data=sashelp.prdsale noborder;
styleattrs datacolors=(gold olive);
vbar product / response=actual stat=sum
group=year groupdisplay=cluster
dataskin=pressed baselineattrs=(thickness=0)
filltype=gradient datalabel;
xaxis display=(nolabel noline noticks);
yaxis display=(noline) grid;
run;
/*--Response Cluster Stack VBar--*/
ods graphics / reset width=4.5in height=3in imagename='BarChartClusterStack';
title 'Sales by Type, Year and Quarter';
proc sgpanel data=sashelp.prdsale;
styleattrs datacolors=(gold olive &softgreen silver);
panelby product / onepanel rows=1 noborder layout=columnlattice
noheaderborder novarname colheaderpos=bottom;
vbar year / response=actual stat=sum group=quarter barwidth=1
dataskin=pressed baselineattrs=(thickness=0) filltype=gradient;
colaxis display=(nolabel noline noticks) valueattrs=(size=7);
rowaxis display=(noline nolabel noticks) grid;
run;
/*--VBar Overlay--*/
ods graphics / reset width=&w height=3in imagename='BarChartOverlay';
title 'Mileage by Type';
proc sgplot data=sashelp.cars noborder;
styleattrs datacolors=(olive gold);
vbar type / response=mpg_city stat=mean
dataskin=pressed baselineattrs=(thickness=0) ;
vbar type / response=mpg_highway stat=mean
dataskin=pressed baselineattrs=(thickness=0)
barwidth=0.5;
xaxis display=(nolabel noline noticks);
yaxis display=(noline) grid;
run;
/*--VBar Overlay Offset--*/
ods graphics / reset width=&w height=3in imagename='BarChartOverlayOffset';
title 'Mileage by Type';
proc sgplot data=sashelp.cars noborder;
styleattrs datacolors=(brown olive);
vbar type / response=mpg_highway stat=mean
dataskin=pressed barwidth=0.6
baselineattrs=(thickness=0)
discreteoffset=-0.1;
vbar type / response=mpg_city stat=mean
dataskin=pressed barwidth=0.6
baselineattrs=(thickness=0)
discreteoffset= 0.1;
xaxis display=(nolabel noline noticks);
yaxis display=(noline) grid;
run;