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}];t.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){if(!arguments.length)returnb;b=a;returnt},t.width=function(a){if(!arguments.length)returnc;c=a;returnt},t.height=function(a){if(!arguments.length)returnd;d=a;returnt},t.color=function(a){if(!arguments.length)returne;e=a,o.color(a);returnt},t.showControls=function(a){if(!arguments.length)returnf;f=a;returnt},t.showLegend=function(a){if(!arguments.length)returng;g=a;returnt},t.tooltips=function(a){if(!arguments.length)returnh;h=a;returnt},t.tooltipContent=function(a){if(!arguments.length)returni;i=a;returnt};returnt},a.models.pie=function(){functionl(h){h.each(function(h){functionA(a){a.innerRadius=0;varb=d3.interpolate({startAngle:0,endAngle:0},a);returnfunction(a){returnt(b(a))}}functionz(a){j||(a.innerRadius=0);varb=d3.interpolate(this._current,a);this._current=b(0);returnfunction(a){returnt(b(a))}}functiony(a){varb=(a.startAngle+a.endAngle)*90/Math.PI-90;returnb>90?b-180:b}varl=b-a.left-a.right,m=c-a.top-a.bottom,n=Math.min(l,m)/2,o=d3.select(this).on("click",function(a,b){k.chartClick({data:a,index:b,pos:d3.event,id:f})}),p=o.selectAll(".wrap.pie").data([h]),q=p.enter().append("g").attr("class","wrap nvd3 pie chart-"+f),r=q.append("g"),s=p.select("g");r.append("g").attr("class","pie"),p.attr("transform","translate("+a.left+","+a.top+")"),s.select(".pie").attr("transform","translate("+l/2+","+m/2+")");vart=d3.svg.arc().outerRadius(n-n/5);j&&t.innerRadius(n/2);varu=d3.layout.pie().sort(null).value(function(a){returna.disabled?0:e(a)}),v=p.select(".pie").selectAll(".slice").data(u);v.exit().remove();varw=v.enter().append("svg:g").attr("class","slice").on("mouseover",function(a,b){d3.select(this).classed("hover",!0),k.elementMouseover({label:d(a.data),value:e(a.data),point:a.data,pointIndex:b,pos:[d3.event.pageX,d3.event.pageY],id:f})}).on("mouseout",function(a,b){d3.select(this).classed("hover",!1),k.elementMouseout({label:d(a.data),value:e(a.data),point:a.data,index:b,id:f})}).on("click",function(a,b){k.elementClick({label:d(a.data),value:e(a.data),point:a.data,index:b,pos:d3.event,id:f}),d3.event.stopPropagation()}).on("dblclick",function(a,b){k.elementDblClick({label:d(a.data),value:e(a.data),point:a.data,index:b,pos:d3.event,id:f}),d3.event.stopPropagation()});v.attr("fill",function(a,b){returng[b]});varx=w.append("svg:path").each(function(a){this._current=a});d3.transition(v.select("path")).attr("d",t).attrTween("d",z),i&&(w.append("text").attr("transform",function(a){a.outerRadius=n+10,a.innerRadius=n+15;return"translate("+t.centroid(a)+")"}).style("text-anchor","middle").style("fill","#000"),d3.transition(v.select("text")).attr("transform",function(a){a.outerRadius=n+10,a.innerRadius=n+15;return"translate("+t.centroid(a)+")"}).text(function(a,b){returna.value?d(a.data):""}))});returnl}vara={top:0,right:0,bottom:0,left:0},b=500,c=500,d=function(a){returna.key},e=function(a){returna.y},f=Math.floor(Math.random()*1e4),g=d3.scale.category20().range(),h=d3.format(",.2f"),i=!0,j=!1,k=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout");l.dispatch=k,l.margin=function(b){if(!arguments.length