%let name=col4; filename odsout '.'; data a; length class $ 8.; input TIME sales expenses; amount=sales-expenses; if (sales ge expenses) then do; class='Profit'; output; /* net profit */ class='Sales'; amount=sales-(sales-expenses); output; class='Expenses'; amount=-1*expenses; output; end; else do; class='Deficit'; output; /* net loss */ class='Sales'; amount=sales; output; class='Expenses'; amount=-1*(expenses-(expenses-sales)); output; end; cards; 1 3.6 4.4 2 5.1 7.0 3 3.0 5.0 4 5.0 7.5 5 7.0 8.1 6 9.5 11.0 7 9.0 7.0 8 11.0 9.0 9 10.2 7.3 10 9.1 6.8 11 10.1 8.8 12 10.0 9.3 ; run; data a; set a; length htmlvar $500; htmlvar='title='||quote( 'Time: '|| trim(left(time)) ||'0D'x|| 'Class: '|| trim(left(Class)) ||'0D'x|| 'Sales: '|| trim(left(Sales)) ||'0D'x|| 'Expenses: '|| trim(left(Expenses)) ) ||' '|| 'href="col5.htm"'; run; GOPTIONS DEVICE=gif; ODS LISTING CLOSE; ODS HTML path=odsout body="&name..htm" (title="Gross-Deviation Column Chart") style=minimal; goptions noborder; goptions gunit=pct htitle=6 ftitle="albany amt/bold" htext=4.25 ftext="albany amt/bold"; axis1 label=('TIME'); axis2 label=(a=90 'AMOUNT') order=(-12 to 12 by 4) minor=(number=1) offset=(0,0); pattern1 v=solid color=cxbd0026; /* reddish - ie 'in the red' */ pattern2 v=solid color=cx43a2ca; /* this is the hex rgb color for mild blue */ pattern3 v=solid color=gray55; /* blackish - ie 'in the black' (profit) */ pattern4 v=solid color=cxc7e9b4; /* kind of a seafoam green */ title "Gross-Deviation Column Chart"; proc gchart data=a; vbar time / discrete type=sum sumvar=amount subgroup=class /* this controls the coloring */ maxis=axis1 /* midpoint axis */ raxis=axis2 /* response/numeric axis */ autoref /* reflines at every major axis tickmark */ cref=graycc clipref /* put reflines behind the bars */ cref=graycc coutline=black /* width=7.5 */ nolegend html=htmlvar des="" name="&name" ; run; quit; ODS HTML CLOSE; ODS LISTING;