%let gpath='C:\'; %let dpi=150; ods html close; ods listing image_dpi=&dpi gpath=&gpath; data weatherTable; input Month $ high low precip; highC = (high-32) / 1.8; lowC = (low-32) / 1.8; label high= 'High(F)'; label low = 'Low(F)'; label highc='High(C)'; label lowc= 'Low(C)'; label precip= 'Precipitation (in)'; format high low 2.0; format highc lowc precip 4.1; x1='High(F)'; x2='Low(F)'; x3='High(C)'; x4='Low(C)'; x5='Precip(in)'; id=_n_; if mod(id, 2)=0 then ref=month; datalines; Jan 49 30 4.46 Feb 53 32 3.53 Mar 61 40 4.46 Apr 71 48 2.98 May 78 57 4.03 Jun 84 65 4.06 Jul 88 69 4.35 Aug 86 68 4.30 Sep 80 62 4.27 Oct 70 49 3.28 Nov 61 42 3.06 Dec 52 33 3.25 ; run; proc sort data=weatherTable out=weatherTable2; by descending id; run; /*ods html style=listing;*/ /*proc print data=weatherTable(obs=10) noobs;run;*/ /*ods html close;*/ proc template; define style Styles.HtmlblueSF; parent = styles.Htmlblue; style GraphFonts from GraphFonts / 'GraphDataFont' = (", ",8pt) 'GraphValueFont' = (", ",8pt); end; run; /*--Graph with two side Axis Table inside--*/ ods listing style=Styles.HtmlblueSF; ods graphics / reset width=3in height=2.25in imagename='Axis_Table_Graph_Both_In'; title "Monthly Temperatures Ranges for City"; proc sgplot data=weatherTable2 noautolegend; band y=month lower=low upper=high / transparency=0.6; scatter y=month x=high / markerattrs=graphdata1(symbol=circlefilled size=11) dataskin=sheen filledoutlinedmarkers markerfillattrs=(color=lightgray) markeroutlineattrs=graphdata1; scatter y=month x=low / markerattrs=graphdata2(symbol=circlefilled size=11) dataskin=sheen filledoutlinedmarkers markerfillattrs=(color=lightgray) markeroutlineattrs=graphdata2; yaxistable low high / label labelattrs=(size=6 weight=bold) location=inside position=left; yaxistable lowc highc / label labelattrs=(size=6 weight=bold) location=inside position=right; xaxis display=(nolabel) grid; yaxis display=(nolabel noticks) colorbands=odd colorbandsattrs=(color=gray transparency=0.9); run; /*--Graph with two side Axis Table inside--*/ ods graphics / reset width=3in height=2.25in imagename='Axis_Table_Graph_Both_In_X2'; title "Monthly Temperatures Ranges for City"; proc sgplot data=weatherTable2 noautolegend; band y=month lower=low upper=high / transparency=0.6 x2axis; scatter y=month x=high / markerattrs=graphdata1(symbol=circlefilled size=11) dataskin=sheen filledoutlinedmarkers x2axis markerfillattrs=(color=lightgray) markeroutlineattrs=graphdata1; scatter y=month x=low / markerattrs=graphdata2(symbol=circlefilled size=11) dataskin=sheen filledoutlinedmarkers x2axis markerfillattrs=(color=lightgray) markeroutlineattrs=graphdata2; yaxistable low high / label labelattrs=(size=6 weight=bold) location=inside position=left; yaxistable lowc highc / label labelattrs=(size=6 weight=bold) location=inside position=right; x2axis display=(nolabel) grid ; yaxis display=(nolabel noticks) colorbands=odd colorbandsattrs=(color=gray transparency=0.9); run; /*--Split Axis Tick Values--*/ ods graphics / reset width=3in height=2in imagename="Axis_TickValue_Split"; title 'Cholesterol by Cause of Death'; proc sgplot data=sashelp.heart; vbar deathcause / response=cholesterol stat=mean dataskin=gloss; xaxis display=(nolabel); run; /*--Jitter--*/ proc sort data=sashelp.cars out=cars; by mpg_city; run; ods graphics / reset width=3in height=2in imagename='Jitter_SG_Discrete_Y'; proc sgplot data=cars; scatter y=origin x=mpg_city / jitter markerattrs=graphdata1(size=11 symbol=circlefilled) filledoutlinedmarkers markeroutlineattrs=(thickness=0) dataskin=sheen; yaxis display=(nolabel); xaxis grid; run; /*--GTL Annotate--*/ /*--Template for Car Statistics--*/ proc template; define statgraph CarStats; dynamic _min1 _max1 _min2 _max2; begingraph; entrytitle 'Vehicle Statistics'; layout lattice / columns=2; layout overlay / xaxisopts=(offsetmin=_min1 offsetmax=_max1) yaxisopts=(offsetmin=0); barchart x=origin y=mpg_city / stat=mean group=type groupdisplay=cluster dataskin=gloss; annotate / id='Bar'; endlayout; layout overlay / xaxisopts=(offsetmin=_min2 offsetmax=_max2) yaxisopts=(offsetmin=0); histogram mpg_city; densityplot mpg_city; annotate / id='Hist'; endlayout; endlayout; endgraph; end; run; /*--Create Annotation data set for side text--*/ data anno; length id $8 anchor $8; retain function 'text' drawspace 'wallpercent'; retain textsize 10 textweight 'bold'; width=200; textsize=8; id='Bar'; x1=0; y1=50; rotate=90; anchor='top'; label="Mileage by Origin and Type";output; id='Hist';x1=100; y1=50; rotate=90; anchor='bottom'; border='true'; label="Distribution of Mileage"; output; run; /*--Create the Graph with Cell header annotation--*/ ods graphics / reset width=3.5in height=2.5in imagename='Anno_GTL_SideText'; proc sgrender data=sashelp.cars(where=(type in ('Sedan' 'Sports' 'SUV'))) template=CarStats sganno=anno; dynamic _min1=0.28; run;