%let name=legend; filename odsout '.'; 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 $500; htmlvar='title='||quote( 'State: '|| trim(left(st)) ||'0D'x|| 'Population: '|| trim(left(put(population,comma12.0))) ) ||' '|| 'href="http://www.state.'||trim(left(lowcase(st)))||'.us"'; run; GOPTIONS DEVICE=gif; ODS LISTING CLOSE; ODS HTML path=odsout body="&name..htm" (title="GIF ODS HTML Bar Chart w/ HTML_LEGEND drilldown") style=minimal gtitle gfootnote; goptions noborder; goptions gunit=pct htitle=6 ftitle="arial/bo" htext=4 ftext="arial"; axis1 label=none; axis2 label=none minor=none offset=(0,0); legend1 label=none shape=bar(3,4); /* Don't change the order of the legend items if you're using html_legend - the drilldowns stay in the original order and no longer match the right legend items. order=('SC' 'VA' 'NC' 'GA' 'FL') */ pattern1 v=solid color=cx66c2a5; pattern2 v=solid color=cxfc8d62; pattern3 v=solid color=cx8da0cb; pattern4 v=solid color=cxe78ac3; pattern5 v=solid color=cxa6d854; title "Year 2000 U.S. Census Population"; title2 color=gray "GCHART w/ GIF ODS HTML Drilldown"; footnote color=gray "(Each color square in legend has an html drilldown)"; proc gchart data=mydata; hbar st / discrete subgroup=st type=sum sumvar=population ascending nostats maxis=axis1 raxis=axis2 autoref cref=gray clipref coutline=black legend=legend1 html_legend=htmlvar des="" name="&name" ; run; quit; ODS HTML CLOSE; ODS LISTING;