(function(pa){function qc(){function n(e,c){e.attr("transform",function(e){return"translate("+(c(e)+U)+", 0)"})}function s(e,c){e.attr("transform",function(e){return"translate(0,"+c(e)+")"})}function pa(e){var c=e[0];e=e[e.length-1];return ca?0:a}function fa(a){var b=Ia[a.id];a.name=n(b)?b:a.id;return a}function Ca(a){var b=a[0],d={},h=[],e,c;for(e=1;ev[d].indexOf(e.id)))for(h=0;h=g;g+=t)r+=e(a[c-1],a[c],g,u)}return r}function tb(a){var b=k.data.targets= ga(a),d,c;fc=e.select(ta);if(fc.empty())pa.alert('No bind element found. Check the selector specified by "bindto" and existance of that element. Default "bindto" is "#chart".');else{P();U();m.domain(e.extent(a.map(function(a){return a.x})));z.domain(C(b,"y"));Q.domain(C(b,"y2"));X.domain(m.domain());Ua.domain(z.domain());Va.domain(Q.domain());O.ticks(10>a.length?a.length:10);ja.ticks(Oc).outerTickSize(0).tickFormat(Pc);Wa.ticks(Qc).outerTickSize(0).tickFormat(Rc);R=m.domain();F.x(X);ma&&G.x(m);Ma= e.select(ta).append("svg").attr("width",q+I+D).attr("height",t+w+W).on("mouseenter",Sc).on("mouseleave",Tc);bb=Ma.append("defs");bb.append("clipPath").attr("id",ub).append("rect").attr("y",w).attr("width",q).attr("height",t-w);bb.append("clipPath").attr("id","xaxis-clip").append("rect").attr("x",-1).attr("y",-1).attr("width",q+2).attr("height",40);bb.append("clipPath").attr("id","yaxis-clip").append("rect").attr("x",-I+1).attr("y",w-1).attr("width",I).attr("height",t-w+2);g=Ma.append("g").attr("transform", J.main);y=wa?Ma.append("g").attr("transform",J.context):null;xa=ya?Ma.append("g").attr("transform",J.legend):null;aa=e.select(ta).style("position","relative").append("div").style("position","absolute").style("width","30%").style("z-index","10").style("visibility","hidden");g.append("g").attr("class","x axis").attr("clip-path",f?"":"url(#xaxis-clip)").attr("transform",J.x).call(f?ja:O);g.append("g").attr("class","y axis").attr("clip-path",f?"url(#yaxis-clip)":"").call(f?O:ja).append("text").attr("transform", "rotate(-90)").attr("dy","1.4em").attr("dx","-.8em").style("text-anchor","end").text(Uc);Jb&&g.append("g").attr("class","y2 axis").attr("transform",J.y2).call(Wa);d=g.append("g").attr("clip-path",Na).attr("class","grid");gc&&d.append("g").attr("class","xgrids");vb&&(c=d.append("g").attr("class","xgrid-lines").selectAll(".xgrid-line").data(vb).enter().append("g").attr("class","xgrid-line"),c.append("line").attr("class",function(a){return""+a["class"]}),c.append("text").attr("class",function(a){return""+ a["class"]}).attr("text-anchor","end").attr("transform",f?"":"rotate(-90)").attr("dx",f?0:-w).attr("dy",-6).text(function(a){return a.text}));Vc&&d.append("g").attr("class","xgrid-focus").append("line").attr("class","xgrid-focus").attr("x1",f?0:-10).attr("x2",f?q:-10).attr("y1",f?-10:w).attr("y2",f?-10:t);hc&&d.append("g").attr("class","ygrids");wb&&d.append("g").attr("class","ygrid-lines").selectAll("ygrid-line").data(wb).enter().append("line").attr("class",function(a){return"ygrid-line "+a["class"]}); g.append("g").attr("clip-path",Na).attr("class","regions");g.append("g").attr("clip-path",Na).attr("class","chart");g.select(".chart").append("g").attr("class","event-rects").style("fill-opacity",0).style("cursor",ma?"ew-resize":null).selectAll(".event-rects").data(a).enter().append("rect").attr("class",function(a,b){return"event-rect event-rect-"+b}).style("cursor",ba&&na?"pointer":null).on("mouseover",function(a,b){if(!cb){var d=k.data.targets.map(function(a){return fa(a.values[b])}),c,h;if(0",d,c,e;for(d=0;d"+e+""+c+"";return b+""}),Yc=c(["tooltip","init","show"],!1),za=c(["tooltip","init","x"],0),mc=c(["tooltip","init","position"],{top:"0px",left:"50px"}),ub=ta.replace("#","")+"-clip",Na="url(#"+ ub+")",E="timeseries"===pc,ka="categorized"===pc,zb=null,cb=!1,yb=!1,ha=ya?40:0,la=e.time.format(dd).parse,S=function(a,b){var d=[],c=null!==b?b:"#1f77b4 #ff7f0e #2ca02c #d62728 #9467bd #8c564b #e377c2 #7f7f7f #bcbd22 #17becf".split(" ");return function(b){if(b in a)return a[b];-1===d.indexOf(b)&&d.push(b);return c[d.indexOf(b)%c.length]}}(ed,fd),vc=function(){var a=[[e.time.format("%Y/%-m/%-d"),function(){return!0}],[e.time.format("%-m/%-d"),function(a){return a.getMonth()}],[e.time.format("%-m/%-d"), function(a){return 1!==a.getDate()}],[e.time.format("%-m/%-d"),function(a){return a.getDay()&&1!==a.getDate()}],[e.time.format("%I %p"),function(a){return a.getHours()}],[e.time.format("%I:%M"),function(a){return a.getMinutes()}],[e.time.format(":%S"),function(a){return a.getSeconds()}],[e.time.format(".%L"),function(a){return a.getMilliseconds()}]];return function(b){for(var d=a.length-1,c=a[d];!c[1](b);)c=a[--d];return c[0](b)}}(),Gb,Lb,Ib,Ta,Kb,Mb,q,t,ia,gb,ua,Nb,Ob,jb,kb,m,z,Q,X,Ua,Va,O,ja,Wa, Ea,rc=f?"left":"bottom",sc=f?ib?"top":"bottom":ib?"right":"left",tc=f?hb?"bottom":"top":hb?"left":"right",uc="bottom",J={main:function(){return"translate("+I+","+w+")"},context:function(){return"translate("+H+","+Aa+")"},legend:function(){return"translate("+Cb+","+Bb+")"},y2:function(){return"translate("+(f?0:q)+","+(f?10:0)+")"},x:function(){return"translate(0,"+t+")"},subx:function(){return"translate(0,"+ia+")"}},$c=function(){var a=e.svg.line().x(f?function(a){return ea(a.id)(a.value)}:ab).y(f? ab:function(a){return ea(a.id)(a.value)});return function(b){var d=dc(b.values),c;if(rb(b))return"spline"===$["string"===typeof b?b:b.id]?a.interpolate("cardinal"):a.interpolate("linear"),0b.classes.indexOf(a)})});return K};k.data.get=function(a){a=k.data.getAsTarget(a);return n(a)?a.values.map(function(a){return a.value}):void 0};k.data.getAsTarget=function(a){var b=Xa(function(b){return b.id===a});return 0