$(window).on("load",(function(){var t=d3.select("#line-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,l=d3.time.format("%d-%b-%y"),r=d3.time.scale().range([0,a]),i=d3.scale.linear().range([n,0]),d=d3.svg.axis().scale(r).orient("bottom"),o=d3.svg.axis().scale(i).orient("left"),s=d3.svg.line().x((function(t){return r(t.date)})).y((function(t){return i(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),r.range([0,a]),f.selectAll(".d3-xaxis").call(d),f.selectAll(".d3-line").attr("d",s)}d3.tsv("../../../app-assets/data/d3/line/line.tsv",(function(t){return t.date=l.parse(t.date),t.close=+t.close,t}),(function(t,e){if(t)throw t;r.domain(d3.extent(e,(function(t){return t.date}))),i.domain(d3.extent(e,(function(t){return t.close}))),f.append("g").attr("class","d3-axis d3-xaxis").attr("transform","translate(0,"+n+")").call(d),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","#00BCD4").style("font-size",12).text("Price ($)"),f.append("path").datum(e).attr("class","d3-line").attr("d",s).style("fill","none").style("stroke-width",3).style("stroke","#00BCD4")})),$(window).on("resize",g),$(".menu-toggle").on("click",g)}));