%let gpath='.';
%let dpi=200;
ods html close;
ods listing gpath=&gpath image_dpi=&dpi;
/*--Create data for the infographic chart--*/
data infographics;
format value percent.;
length Industry $15 Filename $100;
input Industry $ Value x y xval yval;
xnam=0; ynam=-1.5;
filename=cat('C:\Work\Blogs\Graphically Speaking\2016\Post_06_Feb_09_Info_Graphics\', Industry);
filename=cat (trim(filename), '_Trans.png');
call symput ("File"|| put(_n_, 1.), trim(filename));
datalines;
Banking 0.26 -0.5 0 0.7 0.8
Government 0.15 0 0.6 0 -0.9
Services 0.11 -0.4 0 0.7 -0.1
Insurance 0.10 0 0.6 0 -0.9
LifeSciences 0.07 -0.5 0.1 0.4 0.4
Retail 0.05 -0.5 0.2 0.4 -0.3
Utilities 0.03 -0.5 0.2 0.4 -0.3
Education 0.02 0 0.5 0 -0.5
;
run;
/*--Create a single cell--*/
ods graphics / reset width=2in height=2in imagename='Infographics1' noborder;
title h=1 '2015 Software Revenue for Utilities';
proc sgplot data=infographics
(where=(industry='Utilities'))
pad=(left=20 right=20 bottom=20) noborder;
symbolimage name=Utilities image="&file7";
styleattrs backcolor=cxfaf3f0;
scatter x=x y=y / group=industry dataskin=sheen
markerattrs=(symbol=Utilities size=120);
text x=xval y=yval text=value / textattrs=(size=24);
text x=xnam y=ynam text=industry / textattrs=(size=12);
xaxis min=-2 max=2 display=none offsetmin=0 offsetmax=0;
yaxis min=-2 max=2 display=none offsetmin=0 offsetmax=0;
run;
/*--Create a horizontal panel--*/
ods graphics / reset width=5in height=2.5in imagename='Infographics2'
attrpriority=none noborder;
title '2015 Software Revenue by Industry';
proc sgpanel data=infographics pad=(left=20 right=20);
panelby industry / noborder noheader spacing=20
onepanel columns=4 sort=data;
symbolimage name=Banking image="&file1";
symbolimage name=Government image="&file2";
symbolimage name=Services image="&file3";
symbolimage name=Insurance image="&file4";
symbolimage name=LifeSciences image="&file5";
symbolimage name=Retail image="&file6";
symbolimage name=Utilities image="&file7";
symbolimage name=Education image="&file8";
styleattrs datasymbols=(Banking Government Services
Insurance LifeSciences Retail Utilities
Education) backcolor=cxfaf3f0;
scatter x=x y=y / group=industry markerattrs=(size=120)
dataskin=sheen;
text x=xval y=yval text=value / textattrs=(size=14);
text x=xnam y=ynam text=industry / textattrs=(size=7);
colaxis min=-2 max=2 display=none offsetmin=0 offsetmax=0;
rowaxis min=-2 max=2 display=none offsetmin=0 offsetmax=0;
run;
/*--Create a vertical panel--*/
ods graphics / reset width=2.75in height=5in imagename='Infographics3'
attrpriority=none noborder;
title '2015 Software Revenue by Industry';
proc sgpanel data=infographics pad=(left=20 right=20);
panelby industry / noborder noheader spacing=20
onepanel columns=2 sort=data;
symbolimage name=Banking image="&file1";
symbolimage name=Government image="&file2";
symbolimage name=Services image="&file3";
symbolimage name=Insurance image="&file4";
symbolimage name=LifeSciences image="&file5";
symbolimage name=Retail image="&file6";
symbolimage name=Utilities image="&file7";
symbolimage name=Education image="&file8";
styleattrs datasymbols=(Banking Government Services
Insurance LifeSciences Retail
Utilities Education) backcolor=cxfaf3f0;
scatter x=x y=y / group=industry markerattrs=(size=120) dataskin=sheen;
text x=xval y=yval text=value / textattrs=(size=14);
text x=xnam y=ynam text=industry / textattrs=(size=7);
colaxis min=-2 max=2 display=none offsetmin=0 offsetmax=0;
rowaxis min=-2 max=2 display=none offsetmin=0 offsetmax=0;
run;