%let name=purbar; filename odsout '.'; data my_data; label barrels="Annual Production (Millions of Barrels oil, gas, and water)"; length type $10; input year barrels type; datalines; 1980 2.1 Oil 1981 2.8 Oil 1982 3.2 Oil 1983 2.8 Oil 1984 2.5 Oil 1985 2.2 Oil 1986 2.0 Oil 1987 0.9 Oil 1988 .87 Oil 1989 0.4 Oil 1980 2.2 Gas 1981 3.8 Gas 1982 3.5 Gas 1983 2.8 Gas 1984 3.1 Gas 1985 2.31 Gas 1986 2.15 Gas 1987 1.85 Gas 1988 1.2 Gas 1989 .98 Gas 1980 2.4 Water 1981 2.2 Water 1982 2.8 Water 1983 3.01 Water 1984 3.1 Water 1985 2.88 Water 1986 3.3 Water 1987 3.8 Water 1988 3.2 Water 1989 2.5 Water ; run; /* Calculating this for the html charttip (gbarline can automatically calculate it for the bar height). */ proc sql; create table my_data as select *, sum(barrels) as sum_bar, avg(barrels) as avg_bar from my_data group by year; quit; run; data my_data; set my_data; length myhtml $200; myhtml= 'title='||quote( 'Year: '||trim(left(year))||'0D'x|| 'Oil+Gas+Water total: '||trim(left(put(sum_bar,comma5.2)))||'0D'x|| '(Oil+Gas+Water)/3 avg: '||trim(left(put(avg_bar,comma5.2))))|| ' href="purbar_info.htm"'; run; goptions device=png; goptions border cback=cxdad5c0; ODS LISTING CLOSE; ODS HTML path=odsout body="&name..htm" (title="SAS/Graph 2d gbarline - Carpinteria Oil Fields plot") style=d3d gtitle nogfootnote; title1 ls=1.5 "Carpinteria Oil Fields"; title2 "Bar is sum of oil+gas+water, Line is annual mean"; footnote link="http://www.visualmining.com/examples/serverexamples/combochart6.html" h=12pt c=magenta "Imitation of this 'visual mining inc' plot (click here to see)"; axis1 order=(0 to 10 by 2) minor=none offset=(0,0) label=(angle=90); axis2 order=(0 to 10 by 2) minor=none offset=(0,0) label=none; axis3 offset=(6,6) label=none; goptions ftitle="albany amt/bold" ftext="albany amt" gunit=pct htitle=4.5 htext=2.5; pattern1 v=s c=cx65479e; pattern2 v=s c=cx989a30; pattern3 v=s c=cx0083a0; symbol i=join ci=cxffff4f w=4 v=dot cv=cxffff4f h=5; proc gbarline data=my_data; bar year / type=sum sumvar=barrels discrete axis=axis1 maxis=axis3 autoref clipref cref=white lref=1 width=8 cframe=gray nolegend coutline=black html=myhtml des='' name="&name"; plot / type=mean sumvar=barrels axis=axis2; run; quit; ODS HTML CLOSE; ODS LISTING;