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