%let name=col5; filename odsout '.'; data a; input CATEGORY SERIES $ 3-11 AMOUNT; cards; 1 Series A 5.0 2 Series A 6.8 3 Series A 9.2 1 Series B 6.5 2 Series B 6.9 3 Series B 5.6 1 Series C 2.3 2 Series C 3.1 3 Series C 2.3 ; run; proc sql; create table a as select *, sum(amount) as bartotal from a group by category; quit; run; data a; set a; format catpct percent6.0; catpct=amount/bartotal; run; data a; set a; length htmlvar $500; htmlvar='title='||quote( 'Category: '|| trim(left(category)) ||'0D'x|| 'Series: '|| trim(left(series)) ||'0D'x|| 'Amount: '|| trim(left(amount)) ||'0D'x|| 'Percent: '|| trim(left(put(catpct,percent6.0)))||' of '||trim(left(bartotal)) ) ||' '|| 'href="col6.htm"'; run; run; GOPTIONS DEVICE=gif; ODS LISTING CLOSE; ODS HTML path=odsout body="&name..htm" (title="100% Stacked Column") style=minimal; goptions noborder; goptions gunit=pct htitle=6 ftitle="albany amt/bold" htext=4.25 ftext="albany amt/bold"; axis1 label=('CATEGORY') offset=(8,8); axis2 label=(a=90 'PERCENT') order=(0 to 1 by .2) minor=(number=1) offset=(0,0); pattern1 v=solid color=cx9999ff; /* light blue */ pattern2 v=solid color=cx993366; /* purplish */ pattern3 v=solid color=cxffffcc; /* pale yellow */ title "100% Stacked Column"; title2 "Compares the percent each value contributes"; title3 "to a total across categories"; proc gchart data=a; vbar category / discrete type=sum sumvar=catpct subgroup=series /* this controls the coloring */ autoref clipref cref=graycc maxis=axis1 raxis=axis2 nolegend coutline=black width=8 space=3 html=htmlvar des="" name="&name" ; run; quit; ODS HTML CLOSE; ODS LISTING;