ods html close; %let gpath='C:\'; %let dpi=100; /*--Multi column data by test--*/ data Lab_Trt; drop dec; format Date date7.; retain dec 1; retain Zero 0; do Date='01Jan2011'd, '07Jan2011'd, '14Jan2011'd, '01Feb2011'd, '01Mar2011'd, '01Apr2011'd, '01Jun2011'd; Value=dec *(2+ranuni(2)/2); Drug='A'; output; Value=dec *(2+ranuni(2)/2); Drug='B'; output; dec = dec*0.95; end; run; /*--Softer color style--*/ proc template; define Style htmlbluesoft; parent = styles.htmlblue; style GraphColors from graphcolors / "gdata1" = cxbfcfff "gdata2" = cxffcfbf "gcdata1" = cx000000 "gcdata2" = cx000000; end; run; ods listing style=Htmlbluesoft gpath=&gpath image_dpi=&dpi; /*--Bar Chart--*/ ods graphics / reset width=5in height=3in imagename="BarChart"; title h=10pt 'Lab Values by Time and Treatment'; footnote j=l 'Bar Chart on Discrete Axis'; proc sgplot data=Lab_Trt; refline 1 1.5 2 / lineattrs=graphgridlines; vbar date / response=value group=Drug groupdisplay=cluster barwidth=0.9; xaxis discreteorder=data display=(nolabel); yaxis label='Maximum (/ULN)'; run; /*--HighLow Plot--*/ ods graphics / reset width=5in height=3in imagename="BarChartInterval"; title 'Lab Values by Time and Treatment'; footnote j=l 'HighLow plot on Interval Axis'; proc sgplot data=Lab_Trt; refline 1 1.5 2 / lineattrs=graphgridlines; ; highlow x=date high=value low=zero / type=bar group=Drug groupdisplay=cluster lineattrs=(color=black); xaxis discreteorder=data display=(nolabel); yaxis label='Maximum (/ULN)' offsetmin=0; run; /*--Needle Plot--*/ ods listing style=Htmlblue gpath=&gpath image_dpi=&dpi; ods graphics / reset width=5in height=3in imagename="NeedlePlot"; title 'Lab Values by Time and Treatment'; footnote j=l 'Needle Plot on Interval Axis'; proc sgplot data=Lab_Trt; refline 1 1.5 2 / lineattrs=graphgridlines; needle x=date y=value / group=Drug groupdisplay=cluster lineattrs=(thickness=5); xaxis discreteorder=data display=(nolabel); yaxis label='Maximum (/ULN)'; run;