%let name=piegif;
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 Drilldown Pie Chart") style=minimal;
 goptions noborder;

goptions gunit=pct htitle=6 ftitle="arial/bo" htext=4 ftext="arial";

pattern v=solid color=cx43a2ca repeat=5;  

title "Year 2000 U.S. Census Population";
title2 color=gray "GCHART Pie w/ GIF ODS HTML Drilldown";
footnote color=gray "(Each pie slice has an html drilldown)";
proc gchart data=mydata; 
pie st / discrete 
 type=sum sumvar=population 
 noheading
 ascending
 coutline=black 
/*
 woutline=2
*/
 html=htmlvar
 des="" name="&name" ;  
run;


 quit;
 ODS HTML CLOSE;
 ODS LISTING;
 
