data YTD_2005; input Cat $ Group $ Rev RevLow RevHigh RevTarget Exp ExpLow ExpHigh ExpTarget Siz SizLow SizHigh SizTarget revIndex expIndex; datalines; A Bad 150 0 270 250 35 0 26 27 350 0 325 550 2 3 A OK 80 . . . 40 . . . 150 . . . 1 1 A Good 70 . . . 75 . . . 100 . . . 3 2 ; /*ods html;*/ /*proc print;run;*/ /*ods html close;*/ data YTD_2005_Revenue; input Cat $ Group $ Level Rev Target index; datalines; A Bad 150 270 250 2 A OK 80 . . 1 A Good 70 . . 3 ; /*ods html;*/ /*proc print;run;*/ /*ods html close;*/ data YTD_2005_2; input Cat $ Group $ RevLevel Rev RevTarget ExpLevel Exp ExpTarget revIndex expIndex; datalines; A Bad 150 250 270 35 26 27 2 3 A OK 80 . . 40 . . 1 1 A Good 70 . . 75 . . 3 2 ; /*ods html;*/ /*proc print;run;*/ /*ods html close;*/ %let dpi=200; /*--Template for single bullet graph - Step 1 Bands--*/ proc template; define statgraph KPI_Revenue_1; begingraph; entrytitle '2005 YTD' / textattrs=(weight=bold size=14); layout lattice / rows=1 columns=2 columnweights=(0.25 0.75); layout gridded; entry halign=right "Revenue" / textattrs=graphtitletext(weight=bold size=12); entry halign=right "US $(1000)"; endlayout; layout overlay / yaxisopts=(display=none offsetmin=0.0 offsetmax=0.0) xaxisopts=(display=(ticks tickvalues) offsetmin=0.0 offsetmax=0.0 tickvalueattrs=(size=8)); barchart x=cat y=level / group=group name='a' orient=horizontal barwidth=1.0 outlineattrs=(color=black) skin=satin index=index; endlayout; columnheaders; entry ' '; discretelegend 'a' / border=false valueattrs=(size=8); endcolumnheaders; endlayout; endgraph; end; run; ods listing style=listing image_dpi=&dpi; ods graphics / reset width=4in height=1in imagename="KPI_Revenue_92_1"; proc sgrender data=YTD_2005_Revenue template=KPI_Revenue_1; run; /*--Template for single bullet graph - Step 2 Add Bar--*/ proc template; define statgraph KPI_Revenue_2; begingraph; entrytitle '2005 YTD' / textattrs=(weight=bold size=14); layout lattice / rows=1 columns=2 columnweights=(0.25 0.75); layout gridded; entry halign=right "Revenue" / textattrs=graphtitletext(weight=bold size=12); entry halign=right "US $(1000)"; endlayout; layout overlay / yaxisopts=(display=none offsetmin=0.0 offsetmax=0.0) xaxisopts=(display=(ticks tickvalues) offsetmin=0.0 offsetmax=0.0 tickvalueattrs=(size=8)); barchart x=cat y=level / group=group name='a' orient=horizontal barwidth=1.0 outlineattrs=(color=black) skin=satin index=index; barchart x=cat y=rev / barwidth=0.3 fillattrs=(color=cx3f4fbf) orient=horizontal skin=modern; endlayout; columnheaders; entry ' '; discretelegend 'a' / border=false valueattrs=(size=8); endcolumnheaders; endlayout; endgraph; end; run; ods graphics / reset width=4in height=1in imagename="KPI_Revenue_92_2"; proc sgrender data=YTD_2005_Revenue template=KPI_Revenue_2; run; /*--Template for single bullet graph - Step 3 Add Target--*/ proc template; define statgraph KPI_Revenue_3; begingraph; entrytitle '2005 YTD' / textattrs=(weight=bold size=14); layout lattice / rows=1 columns=2 columnweights=(0.25 0.75); layout gridded; entry halign=right "Revenue" / textattrs=graphtitletext(weight=bold size=12); entry halign=right "US $(1000)"; endlayout; layout overlay / yaxisopts=(display=none offsetmin=0.0 offsetmax=0.0) xaxisopts=(display=(ticks tickvalues) offsetmin=0.0 offsetmax=0.0 tickvalueattrs=(size=8)); barchart x=cat y=level / group=group name='a' orient=horizontal barwidth=1.0 outlineattrs=(color=black) skin=satin index=index; barchart x=cat y=rev / barwidth=0.3 fillattrs=(color=cx3f4fbf) orient=horizontal skin=modern; scatterplot x=target y=cat / markerattrs=(symbol=trianglefilled size=14 color=black) discreteoffset=-0.25; scatterplot x=target y=cat / markerattrs=(symbol=trianglefilled size=10 color=yellow) discreteoffset=-0.26 name='target' legendlabel='Target'; endlayout; columnheaders; entry ' '; discretelegend 'a' 'target'/ border=false backgroundcolor=lightgray valueattrs=(size=8); endcolumnheaders; endlayout; endgraph; end; run; ods graphics / reset width=4in height=1in imagename="KPI_Revenue_92_3"; proc sgrender data=YTD_2005_Revenue template=KPI_Revenue_3; run; /*--Template for bullet Panel--*/ proc template; define statgraph KPI_Panel; begingraph; entrytitle '2005 YTD' / textattrs=(weight=bold size=14); layout lattice / rows=3 columns=2 columnweights=(0.25 0.75) rowgutter=20; layout gridded; entry halign=right "Revenue" / textattrs=graphtitletext(weight=bold size=12); entry halign=right "US $(1000)"; endlayout; layout overlay / yaxisopts=(display=none offsetmin=0.0 offsetmax=0.0) xaxisopts=(display=(ticks tickvalues) offsetmin=0.0 offsetmax=0.0 tickvalueattrs=(size=8)); barchart x=cat y=rev / group=group name='a' orient=horizontal barwidth=1.0 outlineattrs=(color=black) skin=satin index=revindex; barchart x=cat y=revhigh / barwidth=0.3 fillattrs=(color=cx3f4fbf) orient=horizontal skin=modern; scatterplot x=revtarget y=cat / markerattrs=(symbol=trianglefilled size=14 color=black) discreteoffset=-0.25; scatterplot x=revtarget y=cat / markerattrs=(symbol=trianglefilled size=10 color=yellow) discreteoffset=-0.26 name='target' legendlabel='Target'; endlayout; layout gridded; entry halign=right "Expenses" / textattrs=graphtitletext(weight=bold size=12); entry halign=right "US $(1000)"; endlayout; layout overlay / yaxisopts=(display=none offsetmin=0.0 offsetmax=0.0) xaxisopts=(display=(ticks tickvalues) offsetmin=0.0 offsetmax=0.0 reverse=true tickvalueattrs=(size=8)); barchart x=cat y=exp / group=group name='a' orient=horizontal barwidth=1.0 outlineattrs=(color=black) skin=satin index=expindex; barchart x=cat y=exphigh / barwidth=0.3 fillattrs=(color=cx3f4fbf) orient=horizontal skin=modern; scatterplot x=exptarget y=cat / markerattrs=(symbol=trianglefilled size=14 color=black) discreteoffset=-0.25; scatterplot x=exptarget y=cat / markerattrs=(symbol=trianglefilled size=10 color=yellow) discreteoffset=-0.26; endlayout; layout gridded; entry halign=right "Avg Order Size" / textattrs=graphtitletext(weight=bold size=12); entry halign=right "US $"; endlayout; layout overlay / yaxisopts=(display=none offsetmin=0.0 offsetmax=0.0) xaxisopts=(display=(ticks tickvalues) offsetmin=0.0 offsetmax=0.0 tickvalueattrs=(size=8)); barchart x=cat y=siz / group=group name='a' orient=horizontal barwidth=1.0 outlineattrs=(color=black) skin=satin index=revindex; barchart x=cat y=sizhigh / barwidth=0.3 fillattrs=(color=cx3f4fbf) orient=horizontal skin=modern; scatterplot x=siztarget y=cat / markerattrs=(symbol=trianglefilled size=14 color=black) discreteoffset=-0.25; scatterplot x=siztarget y=cat / markerattrs=(symbol=trianglefilled size=10 color=yellow) discreteoffset=-0.26; endlayout; columnheaders; entry ' '; discretelegend 'a' 'target'/ border=false backgroundcolor=lightgray valueattrs=(size=8); endcolumnheaders; endlayout; endgraph; end; run; /*--Draw the Graph--*/ ods graphics / reset width=5in height=2.5in imagename="KPI_Panel_92"; proc sgrender data=YTD_2005 template=KPI_Panel; run; /*--Template for Journal usecase--*/ proc template; define statgraph KPI_Panel_2; begingraph; entrytitle '2005 YTD' / textattrs=(weight=bold size=14); layout lattice / rows=3 columns=2 columnweights=(0.25 0.75) rowgutter=20; layout gridded; entry halign=right "Revenue" / textattrs=graphtitletext(weight=bold size=12); entry halign=right "US $(1000)"; endlayout; layout overlay / yaxisopts=(display=none offsetmin=0.0 offsetmax=0.0) xaxisopts=(display=(ticks tickvalues) offsetmin=0.0 offsetmax=0.0 tickvalueattrs=(size=8)); barchart x=cat y=rev / group=group name='a' orient=horizontal barwidth=1.0 outlineattrs=(color=black) skin=satin index=revindex; barchart x=cat y=revhigh / barwidth=0.3 fillattrs=graphdata1 orient=horizontal skin=modern; scatterplot x=revtarget y=cat / markerattrs=(symbol=trianglefilled size=14 color=black) discreteoffset=-0.25; scatterplot x=revtarget y=cat / markerattrs=(symbol=trianglefilled size=10 color=white) discreteoffset=-0.26 name='target' legendlabel='Target'; endlayout; layout gridded; entry halign=right "Expenses" / textattrs=graphtitletext(weight=bold size=12); entry halign=right "US $(1000)"; endlayout; layout overlay / yaxisopts=(display=none offsetmin=0.0 offsetmax=0.0) xaxisopts=(display=(ticks tickvalues) offsetmin=0.0 offsetmax=0.0 reverse=true tickvalueattrs=(size=8)); barchart x=cat y=exp / group=group name='a' orient=horizontal barwidth=1.0 outlineattrs=(color=black) skin=satin index=expindex; barchart x=cat y=exphigh / barwidth=0.3 fillattrs=graphdata1 orient=horizontal skin=modern; scatterplot x=exptarget y=cat / markerattrs=(symbol=trianglefilled size=14 color=black) discreteoffset=-0.25; scatterplot x=exptarget y=cat / markerattrs=(symbol=trianglefilled size=10 color=white) discreteoffset=-0.26; endlayout; layout gridded; entry halign=right "Avg Order Size" / textattrs=graphtitletext(weight=bold size=12); entry halign=right "US $"; endlayout; layout overlay / yaxisopts=(display=none offsetmin=0.0 offsetmax=0.0) xaxisopts=(display=(ticks tickvalues) offsetmin=0.0 offsetmax=0.0 tickvalueattrs=(size=8)); barchart x=cat y=siz / group=group name='a' orient=horizontal barwidth=1.0 outlineattrs=(color=black) skin=satin index=revindex; barchart x=cat y=sizhigh / barwidth=0.3 fillattrs=graphdata1 orient=horizontal skin=modern; scatterplot x=siztarget y=cat / markerattrs=(symbol=trianglefilled size=14 color=black) discreteoffset=-0.25; scatterplot x=siztarget y=cat / markerattrs=(symbol=trianglefilled size=10 color=white) discreteoffset=-0.26; endlayout; columnheaders; entry ' '; discretelegend 'a' 'target'/ border=false backgroundcolor=lightgray valueattrs=(size=8); endcolumnheaders; endlayout; endgraph; end; run; /*--Draw the Graph - Journal--*/ ods listing style=journal; ods graphics / reset width=5in height=2.5in imagename="KPI_Panel_Gray_92"; proc sgrender data=YTD_2005 template=KPI_Panel_2; run;