%let name=venn; filename odsout '.'; /* Heavily modified version of: http://ftp.sas.com/techsup/download/sample/graph/other-examples-list.html#venn Converting our basic non-proportional sample to something more like the 3rd example on the following page: http://titan.causeway.co.uk/graplnet/asp/vml/venn%20examples.asp */ %let color1=cx000080; %let color2=cx800000; %let color3=cx008080; /* %let color1=blue; %let color2=red; %let color3=green; */ %let text1=Scholars; %let text2=Students; %let text3=Athletes; %let label1=7%; %let label2=23%; %let label3=12%; %let label1_2=3%; %let label2_3=8%; %let label1_3=4%; %let label1_2_3=2%; goptions reset=all; goptions cback=grayfe ctext=black border htitle=7pct htext=4pct ftitle="arial/bo" ftext="arial/bo"; data anno; length text $20 style $12 function $5 color $12; retain xsys '5' ysys '5' hsys '3'; function='pie'; size=25; rotate=360; position='5'; line=0; /* Draw the 3 intersection circles */ x=50; y=60; color="&color1"; style='P1N45';output; x=40; y=35; color="&color2"; style='P1N90';output; x=60; y=35; color="&color3"; style='P1N0';output; /* Put the labels on the pieces of the circles */ function='label'; position='5'; style='"arial/bo"';size=4; color='black'; cbox='grayfe'; x=50; y=75; text="&label1"; output; x=30; y=30; text="&label2"; output; x=70; y=30; text="&label3"; output; x=40; y=53; text="&label1_2"; output; x=50; y=22; text="&label2_3"; output; x=60; y=53; text="&label1_3"; output; x=50; y=45; text="&label1_2_3"; output; run; /* This section generates annotate with shape Legend. */ data legend; length text $20 style $12 function $5 color $12; retain xsys '5' ysys '5' hsys '3'; function='label'; text="&text1"; position='6'; style='"arial/bo"';size=4;x=10;y=80; color='black';output; function='pie'; x=5; size=2.75; color="&color1"; line=0; position='5'; style='P1N45';rotate=360;output; function='label'; text="&text2"; position='6'; style='"arial/bo"';size=4;x=10;y=72; color='black';output; function='pie'; x=5; size=2.75; color="&color2"; line=0; position='5'; style='P1N90';rotate=360;output; function='label'; text="&text3"; position='6'; style='"arial/bo"';size=4;x=10;y=64; color='black';output; function='pie'; x=5; size=2.75; color="&color3"; line=0; position='5'; style='P1N0';rotate=360;output; run; data anno_legend; set anno legend; run; /* Generate a version with labels instead of hatch-marks and 'legend' */ data label; length text $20 style $12 function $5 color $12; retain xsys '5' ysys '5' hsys '3'; function='label'; style='"arial/bo"'; color='black'; size=4; text="&text1"; position='4'; x=30;y=75; output; text="&text2"; position='4'; x=20;y=25; output; text="&text3"; position='6'; x=80;y=25; output; run; data anno_label; set anno label; /* use empty fill pattern instead of cross-hatching */ if substr(style,1,1) eq 'P' then style="pempty"; run; GOPTIONS DEVICE=gif; ODS LISTING CLOSE; ODS HTML path=odsout body="&name..htm" gtitle gfootnote ; /* The Gslide is used to call the Annotate dataset and to specify the footnote under the Venn Diagram. */ title1 'Venn Diagram'; title2 '(non-proportional areas)'; footnote1 h=4pct font="arial/bo" 'Created using SAS/Graph annotate'; proc gslide annotate=anno_legend border des="" name="&name"; run; proc gslide annotate=anno_label border des="" name="&name"; run; quit; ODS HTML CLOSE; ODS LISTING;