proc template; define statgraph sgdesign; dynamic _VISIT _VALUE _GROUP _VISIT2 _VALUE2 _GROUP2 _UCL _LCL _VALUE3; begingraph / designwidth=731 designheight=524; entrytitle halign=center 'ABCD'; layout lattice / rowdatarange=data columndatarange=data rowgutter=10 columngutter=10; layout overlay / wallcolor=CXE8E6E8 xaxisopts=( offsetmin=0.1 offsetmax=0.1 label=('IJKL')) yaxisopts=( label=('EFGH')); seriesplot x=_VISIT y=_VALUE / group=_GROUP name='series' connectorder=xaxis lineattrs=(thickness=3 ); scatterplot x=_VISIT2 y=_VALUE2 / group=_GROUP2 datalabel=_VALUE3 yerrorupper=_UCL yerrorlower=_LCL name='scatter' clusterwidth=0.5 labelstrip=true datalabelposition=TOPLEFT markerattrs=(symbol=CIRCLEFILLED size=11 ) datalabelattrs=(size=12 ); endlayout; sidebar / align=bottom spacefill=false; discretelegend 'scatter' / opaque=true backgroundcolor=CXE8E6E8 border=true halign=center valign=bottom displayclipped=true across=2 order=rowmajor titleattrs=(size=14 ); endsidebar; endlayout; endgraph; end; run; proc sgrender data=WORK.AAAA template=sgdesign; dynamic _VISIT="VISIT" _VALUE="VALUE" _GROUP="GROUP" _VISIT2="VISIT" _VALUE2="VALUE" _GROUP2="GROUP" _UCL="UCL" _LCL="LCL" _VALUE3="VALUE"; run;