%let name=mercury; filename odsout '.'; /* Created this example for Lee Creighton. Here is info from him about the data... I don't think it is proprietary, no. I got it from the following source: Chapter 1, "Are the Fish Safe to Eat? Assessing Mercury Levels in Fish in Marine Lakes" by J. A. Hoeting and A. R. Olsen, of Peck, R., Haugh, L. D., & Goodman , A. (1998) Statistical Case Studies: A Collaboration Between Academe and Industry ASA/SIAM Series on Statistics and Applied Probability */ data my_map; set mapsgfk.us_counties (where=(statecode='ME' and density<=2) drop=resolution); run; /* I let the proc import choose my variable names based on the column headers ... */ PROC IMPORT OUT=anno_pie DATAFILE="Mercury.xls" DBMS=XLS REPLACE; GETNAMES=YES; RUN; /* convert degrees to radians */ data anno_pie; set anno_pie; anno_flag=1; long=-1*longitude; lat=latitude; run; /* project the map */ data combined; set my_map anno_pie; run; proc gproject data=combined out=combined latlong eastlong degrees dupok; id state county; run; data my_map anno_pie; set combined; if anno_flag=1 then output anno_pie; else output my_map; run; /* Might want to sort them, so smaller pies are printed last, so they appear 'on top' of the larger pies (so they don't get obscured). */ proc sort data=anno_pie out=anno_pie; by descending HG_Level; run; /* The gproject runs faster without all these text variables, so add them *after* you do the gproject. */ data anno_pie; set anno_pie; length function style color $8 text $40 html $300; xsys='2'; ysys='2'; hsys='3'; when='a'; function='pie'; style='psolid'; rotate=360; color='red'; size=.2+(1.1*HG_Level); style='psolid'; color='red'; output; html= 'title='||quote( 'Name: '||trim(left(name))||'0d'x|| 'Mercury (Hg): '||trim(left(HG_Level)))|| ' href="http://www.state.me.us/dep/blwq/hg_pres.htm"'; style='pempty'; color='black'; output; run; goptions device=png; goptions iback='ripple.jpg'; goptions border; ODS LISTING CLOSE; ODS HTML path=odsout body="&name..htm" (title="Mercury Levels in Maine - SAS/Graph gmap") style=htmlblue; goptions gunit=pct htitle=6 htext=2.5 ftitle="albany amt/bold" ftext="albay amt"; title1 ls=1.5 "Mercury (Hg) levels of lakes in Maine"; pattern1 v=s c=cornsilk; proc gmap map=my_map data=my_map; id county; choro state / levels=1 coutline=black nolegend anno=anno_pie des='' name="&name"; run; quit; ODS HTML CLOSE; ODS LISTING;