text: nv.models.stackedAreaChart=function(){"use strict";function t(b){return b.each(function(b){var H=d3.select(this),z=this,E=(c||parseInt(H.style("width"))||960)-d.left-d.right,L=(u||parseInt(H.style("height"))||400)-d.top-d.bottom;if(t.update=function(){H.transition().duration(I).call(t)},t.container=this,S.disabled=b.map(function(t){return!!t.disabled}),!w){var M;w={};for(M in S)w[M]=S[M]instanceof Array?S[M].slice(0):S[M]}if(!(b&&b.length&&b.filter(function(t){return t.values.length}).length)){var Y=H.selectAll(".nv-noData").data([C]);return Y.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),Y.attr("x",d.left+E/2).attr("y",d.top+L/2).text(function(t){return t}),t}H.selectAll(".nv-noData").remove(),e=a.xScale(),n=a.yScale();var G=H.selectAll("g.nv-wrap.nv-stackedAreaChart").data([b]),N=G.enter().append("g").attr("class","nvd3 nv-wrap nv-stackedAreaChart").append("g"),T=G.select("g");if(N.append("rect").style("opacity",0),N.append("g").attr("class","nv-x nv-axis"),N.append("g").attr("class","nv-y nv-axis"),N.append("g").attr("class","nv-stackedWrap"),N.append("g").attr("class","nv-legendWrap"),N.append("g").attr("class","nv-controlsWrap"),N.append("g").attr("class","nv-interactive"),T.select("rect").attr("width",E).attr("height",L),h){var V=f?E-D:E;r.width(V),T.select(".nv-legendWrap").datum(b).call(r),d.top!=r.height()&&(d.top=r.height(),L=(u||parseInt(H.style("height"))||400)-d.top-d.bottom),T.select(".nv-legendWrap").attr("transform","translate("+(E-V)+","+-d.top+")")}if(f){var X=[{key:"Stacked",disabled:"zero"!=a.offset()},{key:"Stream",disabled:"wiggle"!=a.offset()},{key:"Expanded",disabled:"expand"!=a.offset()}];D=260*(F.length/3),X=X.filter(function(t){return F.indexOf(t.key)>-1}),s.width(D).color(["#444","#444","#444"]),T.select(".nv-controlsWrap").datum(X).call(s),d.top!=Math.max(s.height(),r.height())&&(d.top=Math.max(s.height(),r.height()),L=(u||parseInt(H.style("height"))||400)-d.top-d.bottom),T.select(".nv-controlsWrap").attr("transform","translate(0,"+-d.top+")")}G.attr("transform","translate("+d.left+","+d.top+")"),v&&T.select(".nv-y.nv-axis").attr("transform","translate("+E+",0)"),y&&(l.width(E).height(L).margin({left:d.left,top:d.top}).svgContainer(H).xScale(e),G.select(".nv-interactive").call(l)),a.width(E).height(L);var P=T.select(".nv-stackedWrap").datum(b);P.transition().call(a),g&&(i.scale(e).ticks(E/100).tickSize(-L,0),T.select(".nv-x.nv-axis").attr("transform","translate(0,"+L+")"),T.select(".nv-x.nv-axis").transition().duration(0).call(i)),m&&(o.scale(n).ticks("wiggle"==a.offset()?0:L/36).tickSize(-E,0).setTickFormat("expand"==a.offset()?d3.format("%"):k),T.select(".nv-y.nv-axis").transition().duration(0).call(o)),a.dispatch.on("areaClick.toggle",function(e){b=1===b.filter(function(t){return!t.disabled}).length?b.map(function(t){return t.disabled=!1,t}):b.map(function(t,n){return t.disabled=n!=e.seriesIndex,t}),S.disabled=b.map(function(t){return!!t.disabled}),A.stateChange(S),t.update()}),r.dispatch.on("stateChange",function(e){S.disabled=e.disabled,A.stateChange(S),t.update()}),s.dispatch.on("legendClick",function(e){if(e.disabled){switch(X=X.map(function(t){return t.disabled=!0,t}),e.disabled=!1,e.key){case"Stacked":a.style("stack");break;case"Stream":a.style("stream");break;case"Expanded":a.style("expand")}S.style=a.style(),A.stateChange(S),t.update()}}),l.dispatch.on("elementMousemove",function(e){a.clearHighlights();var n,r,s,c=[];b.filter(function(t,e){return t.seriesIndex=e,!t.disabled}).forEach(function(i,o){r=nv.interactiveBisect(i.values,e.pointXValue,t.x()),a.highlightPoint(o,r,!0);var l=i.values[r];"undefined"!=typeof l&&("undefined"==typeof n&&(n=l),"undefined"==typeof s&&(s=t.xScale()(t.x()(l,r))),c.push({key:i.key,value:t.y()(l,r),color:p(i,i.seriesIndex)}))});var u=i.tickFormat()(t.x()(n,r));l.tooltip.position({left:s+d.left,top:e.mouseY+d.top}).chartContainer(z.parentNode).enabled(x).valueFormatter(function(t){return o.tickFormat()(t)}).data({value:u,series:c})(),l.renderGuideLine(s)}),l.dispatch.on("elementMouseout",function(){A.tooltipHide(),a.clearHighlights()}),A.on("tooltipShow",function(t){x&&W(t,z.parentNode)}),A.on("changeState",function(e){"undefined"!=typeof e.disabled&&(b.forEach(function(t,n){t.disabled=e.disabled[n]}),S.disabled=e.disabled),"undefined"!=typeof e.style&&a.style(e.style),t.update()})}),t}var e,n,a=nv.models.stackedArea(),i=nv.models.axis(),o=nv.models.axis(),r=nv.models.legend(),s=nv.models.legend(),l=nv.interactiveGuideline(),d={top:30,right:25,bottom:50,left:60},c=null,u=null,p=nv.utils.defaultColor(),f=!0,h=!0,g=!0,m=!0,v=!1,y=!1,x=!0,b=function(t,e,n){return"<h3>"+t+"</h3>"+"<p>"+n+" on "+e+"</p>"},k=d3.format(",.2f"),S={style:a.style()},w=null,C="No Data Available.",A=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),D=250,F=["Stacked","Stream","Expanded"],I=250;i.orient("bottom").tickPadding(7),o.orient(v?"right":"left"),s.updateState(!1);var W=function(e,n){var r=e.pos[0]+(n.offsetLeft||0),s=e.pos[1]+(n.offsetTop||0),l=i.tickFormat()(a.x()(e.point,e.pointIndex)),d=o.tickFormat()(a.y()(e.point,e.pointIndex)),c=b(e.series.key,l,d,e,t);nv.tooltip.show([r,s],c,e.value<0?"n":"s",null,n)};return a.dispatch.on("tooltipShow",function(t){t.pos=[t.pos[0]+d.left,t.pos[1]+d.top],A.tooltipShow(t)}),a.dispatch.on("tooltipHide",function(t){A.tooltipHide(t)}),A.on("tooltipHide",function(){x&&nv.tooltip.cleanup()}),t.dispatch=A,t.stacked=a,t.legend=r,t.controls=s,t.xAxis=i,t.yAxis=o,t.interactiveLayer=l,d3.rebind(t,a,"x","y","size","xScale","yScale","xDomain","yDomain","xRange","yRange","sizeDomain","interactive","useVoronoi","offset","order","style","clipEdge","forceX","forceY","forceSize","interpolate"),t.options=nv.utils.optionsFunc.bind(t),t.margin=function(e){return arguments.length?(d.top="undefined"!=typeof e.top?e.top:d.top,d.right="undefined"!=typeof e.right?e.right:d.right,d.bottom="undefined"!=typeof e.bottom?e.bottom:d.bottom,d.left="undefined"!=typeof e.left?e.left:d.left,t):d},t.width=function(e){return arguments.length?(c=e,t):c},t.height=function(e){return arguments.length?(u=e,t):u},t.color=function(e){return arguments.length?(p=nv.utils.getColor(e),r.color(p),a.color(p),t):p},t.showControls=function(e){return arguments.length?(f=e,t):f},t.showLegend=function(e){return arguments.length?(h=e,t):h},t.showXAxis=function(e){return arguments.length?(g=e,t):g},t.showYAxis=function(e){return arguments.length?(m=e,t):m},t.rightAlignYAxis=function(e){return arguments.length?(v=e,o.orient(e?"right":"left"),t):v},t.useInteractiveGuideline=function(e){return arguments.length?(y=e,e===!0&&(t.interactive(!1),t.useVoronoi(!1)),t):y},t.tooltip=function(e){return arguments.length?(b=e,t):b},t.tooltips=function(e){return arguments.length?(x=e,t):x},t.tooltipContent=function(e){return arguments.length?(b=e,t):b},t.state=function(e){return arguments.length?(S=e,t):S},t.defaultState=function(e){return arguments.length?(w=e,t):w},t.noData=function(e){return arguments.length?(C=e,t):C},t.transitionDuration=function(e){return arguments.length?(I=e,t):I},t.controlsData=function(e){return arguments.length?(F=e,t):F},o.setTickFormat=o.tickFormat,o.tickFormat=function(t){return arguments.length?(k=t,o):k},t};