,"translate("+v/2+","+-b.top+")")),j.width(v).height(w).color(k.map(function(a,b){returna.color||e[b%e.length]}).filter(function(a,b){return!k[b].disabled})),f&&(p.width(180).color(["#444","#444","#444"]),z.select(".controlsWrap").datum(s).attr("transform","translate(0,"+-b.top+")").call(p)),z.attr("transform","translate("+b.left+","+b.top+")");varA=z.select(".barsWrap").datum(k.filter(function(a){return!a.disabled}));d3.transition(A).call(j),m.ticks(w/24).tickSize(-v,0),z.select(".x.axis").transition().duration(0).call(m);varB=z.select(".x.axis").selectAll("g");B.selectAll("line, text").style("opacity",1),n.ticks(v/100).tickSize(-w,0),z.select(".y.axis").attr("transform","translate(0,"+w+")"),d3.transition(z.select(".y.axis")).call(n),o.dispatch.on("legendClick",function(a,b){a.disabled=!a.disabled,k.filter(function(a){return!a.disabled}).length||k.map(function(a){returna.disabled=!1,x.selectAll(".series").classed("disabled",!1),a}),i.transition().call(t)}),p.dispatch.on("legendClick",function(a,b){if(!a.disabled)return;s=s.map(function(a){returna.disabled=!0,a}),a.disabled=!1;switch(a.key){case"Grouped":j.stacked(!1);break;case"Stacked":j.stacked(!0)}i.transition().call(t)}),j.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+b.left,a.pos[1]+b.top],q.tooltipShow(a)}),h&&q.on("tooltipShow",function(a){r(a,u.parentNode)}),j.dispatch.on("elementMouseout.tooltip",function(a){q.tooltipHide(a)}),h&&q.on("tooltipHide",a.tooltip.cleanup),t.update=function(){i.transition().call(t)},t.container=this}),t}varb={top:30,right:20,bottom:50,left:60},c=null,d=null,e=d3.scale.category20().range(),f=!0,g=!0,h=!0,i=function(a,b,c,d,e){return"<h3>"+b+"</h3>"+"<p>"+c+"</p>"},j=a.models.multiBarHorizontal().stacked(!1),k=j.xScale(),l=j.yScale(),m=a.models.axis().scale(k).orient("left").highlightZero(!1).showMaxMin(!1),n=a.models.axis().scale(l).orient("bottom"),o=a.models.legend().height(30),p=a.models.legend().height(30),q=d3.dispatch("tooltipShow","tooltipHide");m.tickFormat(function(a){returna}),n.tickFormat(d3.format(",.1f"));varr=function(b,c){vard=b.pos[0]+(c.offsetLeft||0),e=b.pos[1]+(c.offsetTop||0),f=m.tickFormat()(j.x()(b.point)),g=n.tickFormat()(j.y()(b.point)),h=i(b.series.key,f,g,b,t);a.tooltip.show([d,e],h,b.value<0?"e":"w")},s=[{key:"Grouped"},{key:"Stacked",disabled:!0}];returnt.dispatch=q,t.multibar=j,t.legend=o,t.xAxis=m,t.yAxis=n,d3.rebind(t,j,"x","y","xDomain","yDomain","forceX","forceY","clipEdge","id","delay","showValues","valueFormat"),t.margin=function(a){returnarguments.length?(b=a,t):b},t.width=function(a){returnarguments.length?(c=a,t):c},t.height=function(a){returnarguments.length?(d=a,t):d},t.color=function(a){returnarguments.length?(e=a,o.color(a),t):e},t.showControls=function(a){returnarguments.length?(f=a,t):f},t.showLegend=function(a){returnarguments.length?(g=a,t):g},t.tooltips=function(a){returnarguments.length?(h=a,t):h},t.tooltipContent=function(a){returnarguments.length?(i=a,t):i},t},a.models.pie=function(){functionm(h){returnh.each(function(h){functionz(a){varb=(a.startAngle+a.endAngle)*90/Math.PI-90;returnb>90?b-180:b}functionA(a){k||(a.innerRadius=0);varb=d3.interpolate(this._current,a);returnthis._current=b(0),function(a){returnu(b(a))}}functionB(a){a.innerRadius=0;varb=d3.interpolate({startAngle:0,endAngle:0},a);returnfunction(a){returnu(b(a))}}varm=b-a.left-a.right,n=c-a.top-a.bottom,o=Math.min(m,n)/2,p=d3.select(this).on("click",function(a,b){l.chartClick({data:a,index:b,pos:d3.event,id:f})}),q=p.selectAll(".wrap.pie").data([h]),r=q.enter().append("g").attr("class","wrap nvd3 pie chart-"+f),s=r.append("g"),t=q.select("g");s.append("g").attr("class","pie"),q.attr("transform","translate("+a.left+","+a.top+")"),t.select(".pie").attr("transform","translate("+m/2+","+n/2+")");varu=d3.svg.arc().outerRadius(o-o/5);k&&u.innerRadius(o/2);varv=d3.layout.pie().sort(null).value(function(a){returna.disabled?0:e(a)}),w=q.select(".pie").selectAll(".slice").data(v);w.exit().remove();varx=w.enter().append("svg:g").attr("class","slice").on("mouseover",function