%let name=col4; filename odsout '.'; data my_data; input TIME sales expenses; datalines; 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 my_data; set my_data; length class $8; 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; run; data my_data; set my_data; length htmlvar $300; 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="col4_info.htm"'; run; goptions device=png; goptions noborder; ODS LISTING CLOSE; ODS HTML path=odsout body="&name..htm" (title="GChart Gross-Deviation Column Chart") style=htmlblue; goptions gunit=pct htitle=6 ftitle="albany amt/bold" htext=4.25 ftext="albany amt/bold"; goptions ctext=gray33; 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 */ title1 ls=1.5 "Gross-Deviation Column Chart"; proc gchart data=my_data; vbar time / discrete type=sum sumvar=amount nolegend subgroup=class maxis=axis1 raxis=axis2 autoref cref=graycc clipref width=5 coutline=black html=htmlvar des='' name="&name"; run; quit; ODS HTML CLOSE; ODS LISTING;