%let name=line4; /* Set output options. */ filename odsout '.'; goptions reset=all; goptions device=gif; /* Set colors for indicator features. */ %let gray=gray; %let crefgray=graycc; %let backcolor=grayee; data mydata; format date monname1.; format actual range1 range2 range3 percent6.0; input date date9. actual range1 range2 range3; datalines; 01jan2006 .15 .06 .12 .30 01feb2006 .12 .06 .12 .30 01mar2006 .15 .06 .12 .30 01apr2006 .12 .06 .12 .30 01may2006 .15 .08 .15 .30 01jun2006 .12 .08 .15 .30 01jul2006 .15 .08 .15 .30 01aug2006 .12 .08 .15 .30 01sep2006 .15 .10 .20 .30 01oct2006 .12 .10 .20 .30 01nov2006 .15 .10 .20 .30 01dec2006 .12 .10 .20 .30 ; run; data mydata; set mydata; length htmlvar $200; htmlvar='title='||quote( 'Date: '|| trim(left(put(date,date9.))) ||'0D'x|| 'Actual: '|| trim(left(put(actual,percent6.0))) ) || ' '|| 'href="'||"http://support.sas.com/rnd/datavisualization/dashboards/generic_drilldown.htm"||'"'; run; /* Now, do a little forecasting */ /* This particular data set obviously had a cyclical trend, therefore I chose to use 'proc ucm' to forecast future values. */ proc ucm data=mydata; id date interval=month; model actual; irregular; level; cycle print=smooth; estimate; forecast lead=12 print=decomp outfor=foreout; run; data foreout; set foreout (where=(date ge '01dec2006'd)); length htmlvar $200; if _n_ ne 1 then htmlvar='title='||quote( 'Date: '|| trim(left(put(date,date9.))) ||'0D'x|| 'Forecast: '|| trim(left(put(forecast,percent6.0))) ) || ' '|| 'href="'||"http://support.sas.com/rnd/datavisualization/dashboards/generic_drilldown.htm"||'"'; run; data forecast; set mydata foreout; run; ODS LISTING CLOSE; ODS HTML path=odsout body="&name..htm" (title="Line Chart") style=minimal; goptions noborder; /* Draw the chart and save it with the specified name so it can later be replayed into the desired location of a dashboard. */ goptions gunit=pct htext=10.0 ftext="albany amt/bold" ctext=gray; goptions xpixels=300 ypixels=150; axis1 color=gray label=none order=(0 to .30 by .10) minor=none major=(h=1) value=(h=8pct) offset=(0,0); axis2 color=gray label=none order=('01jan2006'd to '01dec2006'd by month) minor=none offset=(1,1); pattern1 v=s c=cxFF6666; pattern2 v=s c=cxFFFFAA; pattern3 v=s c=cx9AFF9A; symbol1 i=join v=none c=black; symbol2 i=join v=none c=black; symbol3 i=join v=none c=black; symbol4 i=join width=1 v=dot h=5 c=black; symbol5 i=join v=none c=gray; title h=8 " "; /* proc gplot data=mydata; plot range1*date=1 range2*date=2 range3*date=3 range1*date=5 range2*date=5 actual*date=4 / overlay areas=3 vaxis=axis1 haxis=axis2 html=htmlvar des="" name="&name"; run; */ axis3 color=gray label=none order=('01jan2006'd to '01jun2007'd by month) minor=none offset=(1,1); symbol6 i=join width=1 v=dot h=5 c=blue; symbol7 i=join v=none l=3 c=blue; goptions xpixels=380 ypixels=150; proc gplot data=forecast; plot range1*date=1 range2*date=2 range3*date=3 range1*date=5 range2*date=5 forecast*date=6 /* lcl*date=7 ucl*date=7 */ actual*date=4 / overlay areas=3 vaxis=axis1 haxis=axis3 cframe=grayf8 html=htmlvar des="" name="&name"; run; quit; ODS HTML CLOSE; ODS LISTING;