/*--Import CSV data--*/ proc import out= Visits datafile= "C:\visits_visitors.csv" dbms=csv replace; getnames=yes; run; %let gpath='C:\'; %let dpi=200; ods html close; ods listing gpath=&gpath image_dpi=&dpi; /*--Macro by Perry Watts--*/ %macro RGBHex(rr,gg,bb); %sysfunc(compress(CX%sysfunc(putn(&rr,hex2.)) %sysfunc(putn(&gg,hex2.)) %sysfunc(putn(&bb,hex2.)))) %mend RGBHex; /*--Simple replica of original graph--*/ ods graphics / reset width=4.25in height=1.6in noscale noborder imagename='Visits'; proc sgplot data=visits nowall noborder; styleattrs datacolors=(%rgbhex(140, 185, 202) %rgbhex(19, 85, 137)); vbar month / response=views nostatlabel nooutline baselineattrs=(thickness=0); vbar month / response=visitors nostatlabel barwidth=0.5 nooutline baselineattrs=(thickness=0); keylegend / location=outside position=topright noborder valueattrs=(size=5 color=gray); xaxis fitpolicy=thin display=(nolabel noticks noline) valueattrs=(size=6 color=gray); yaxis grid display=(noline noticks nolabel noline) valueattrs=(size=6 color=gray); run; /*--Skinned and gradient (SAS 9.4) version of original graph--*/ ods graphics / reset width=4.25in height=1.6in noscale noborder imagename='Visits_Skin'; proc sgplot data=visits nowall noborder; styleattrs datacolors=(%rgbhex(140, 185, 202) %rgbhex(19, 85, 137)); vbar month / response=views nostatlabel nooutline dataskin=pressed filltype=gradient baselineattrs=(thickness=0); vbar month / response=visitors nostatlabel nooutline dataskin=pressed filltype=gradient baselineattrs=(thickness=0); keylegend / location=outside position=topright across=2 noborder valueattrs=(size=5 color=gray); xaxis fitpolicy=thin display=(nolabel noticks noline) valueattrs=(size=6 color=gray); yaxis grid display=(noline noticks nolabel noline) valueattrs=(size=6 color=gray); run; /*--offset version of original graph with reduced data--*/ ods graphics / reset width=4in height=1.5in noscale noborder imagename='Visits_Offset'; proc sgplot data=visits(where=(month > '01Nov2013'd)) nowall noborder; styleattrs datacolors=(lightblue lightyellow); vbar month / response=views nostatlabel barwidth=0.6 nooutline dataskin=pressed discreteoffset=-0.05 baselineattrs=(thickness=0); vbar month / response=visitors nostatlabel barwidth=0.6 nooutline dataskin=pressed discreteoffset=0.05 baselineattrs=(thickness=0); keylegend / location=outside position=topright noborder valueattrs=(size=5 color=gray); xaxis fitpolicy=thin display=(nolabel noticks noline) valueattrs=(size=6 color=gray); yaxis grid display=(noline noticks nolabel noline) valueattrs=(size=6 color=gray); run;