%let name=overlib; filename odsout '.'; /* This is an example that SAS Solution Consultant Nikola Markovic taught me, using Erik Bosrup's overlib javascript. It provides multiple drilldown choices for each bar, rather than the usual 1 drilldown. */ /* Make sure you don't have another SAS session open, which might have the 'styles' locked, and prevent you from adding this one! (note that the opacity works in firefox, but maybe not in IE) */ proc template; define style styles.mydrill; parent=styles.htmlblue; style body from body / prehtml=' '; end; run; data mydata; format population comma12.0; input st $ 1-2 population; year=2000; datalines; VA 7078515 NC 8049313 SC 4012012 GA 8186453 FL 15982378 ; run; data mydata; set mydata; length htmlvar $1000; htmlvar= 'title='||quote( 'State: '|| trim(left(st)) ||'0D'x|| 'Population: '|| trim(left(put(population,comma12.0))))|| ' href="'||'javascript:void(0);" onclick="return overlib('|| "'State Homepage
Google Search'"||', STICKY, CAPTION,'|| "'Choose a Drilldown', CENTER);"||'" onmouseout="nd();"'; run; goptions device=png noborder; ODS LISTING CLOSE; ODS HTML path=odsout body="&name..htm" (title="SAS/Graph ODS HTML multi-Drilldown Bar gchart") style=mydrill headtext=''; goptions gunit=pct htitle=6 htext=4; axis1 label=none; axis2 label=none minor=none offset=(0,0); pattern v=solid color=cx43a2ca; title1 ls=1.5 "Year 2000 U.S. Census Population"; title2 color=gray "GCHART w/ dev=PNG ODS HTML Drilldown"; footnote color=gray "Each bar has 2 html drilldowns, via javascript"; proc gchart data=mydata; hbar st / discrete type=sum sumvar=population ascending nostats maxis=axis1 raxis=axis2 autoref cref=gray clipref coutline=black html=htmlvar des='' name="&name"; run; quit; ODS HTML CLOSE; ODS LISTING;