$(window).on("load",(function(){var t=d3.select("#bivariate-chart"),a={top:20,right:20,bottom:30,left:50},e=t.node().getBoundingClientRect().width-a.left-a.right,n=500-a.top-a.bottom,r=d3.time.format("%Y%m%d").parse,i=d3.time.scale().range([0,e]),d=d3.scale.linear().range([n,0]),o=d3.svg.axis().scale(i).orient("bottom"),l=d3.svg.axis().scale(d).orient("left"),s=d3.svg.area().x((function(t){return i(t.date)})).y0((function(t){return d(t.low)})).y1((function(t){return d(t.high)})),c=t.append("svg"),f=c.attr("width",e+a.left+a.right).attr("height",n+a.top+a.bottom).append("g").attr("transform","translate("+a.left+","+a.top+")");function g(){e=t.node().getBoundingClientRect().width-a.left-a.right,c.attr("width",e+a.left+a.right),f.attr("width",e+a.left+a.right),i.range([0,e]),f.selectAll(".d3-xaxis").call(o),f.selectAll(".d3-area").attr("d",s)}d3.tsv("../../../app-assets/data/d3/line/bivariate-area.tsv",(function(t,a){if(t)throw t;a.forEach((function(t){t.date=r(t.date),t.low=+t.low,t.high=+t.high})),i.domain(d3.extent(a,(function(t){return t.date}))),d.domain([d3.min(a,(function(t){return t.low})),d3.max(a,(function(t){return t.high}))]),f.append("path").datum(a).attr("class","d3-area").attr("d",s).style("fill","#FF5722"),f.append("g").attr("class","d3-axis d3-xaxis").attr("transform","translate(0,"+n+")").call(o),f.append("g").attr("class","d3-axis d3-yaxis").call(l).append("text").attr("transform","rotate(-90)").attr("y",6).attr("dy",".71em").style("text-anchor","end").style("fill","#FF5722").style("font-size",12).text("Price ($)")})),$(window).on("resize",g),$(".menu-toggle").on("click",g)}));