From 11d504c6cd4208c85cbafbaad2a70db816a0e01a Mon Sep 17 00:00:00 2001 From: Bob Monteverde Date: Thu, 28 Feb 2013 17:34:02 -0500 Subject: [PATCH] Added barColor fucntionality to multibar to imitate what I did for multibarHorizontal --- examples/multiBarChart.html | 3 +- nv.d3.js | 58 +++++++++++++++++++++++++-- nv.d3.min.js | 6 +-- src/models/multiBar.js | 26 ++++++++++++ src/models/multiBarChart.js | 8 +++- src/models/multiBarHorizontalChart.js | 2 +- 6 files changed, 94 insertions(+), 9 deletions(-) diff --git a/examples/multiBarChart.html b/examples/multiBarChart.html index 3cd2569..2372b16 100644 --- a/examples/multiBarChart.html +++ b/examples/multiBarChart.html @@ -66,7 +66,8 @@ var negative_test_data = new d3.range(0,3).map(function(d,i) { return { var chart; nv.addGraph(function() { - chart = nv.models.multiBarChart(); + chart = nv.models.multiBarChart() + .barColor(d3.scale.category20().range()); chart.xAxis .showMaxMin(true) diff --git a/nv.d3.js b/nv.d3.js index ace6dab..78ffec4 100644 --- a/nv.d3.js +++ b/nv.d3.js @@ -5281,6 +5281,8 @@ nv.models.multiBar = function() { , clipEdge = true , stacked = false , color = nv.utils.defaultColor() + , barColor = null // adding the ability to set the color for each rather than the whole group + , disabled // used in conjunction with barColor to communicate from multiBarHorizontalChart what series are disabled , delay = 1200 , xDomain , yDomain @@ -5499,6 +5501,18 @@ nv.models.multiBar = function() { .attr('class', function(d,i) { return getY(d,i) < 0 ? 'nv-bar negative' : 'nv-bar positive'}) .attr('transform', function(d,i) { return 'translate(' + x(getX(d,i)) + ',0)'; }) + if (barColor) { + if (!disabled) disabled = data.map(function() { return true }); + bars + //.style('fill', barColor) + //.style('stroke', barColor) + //.style('fill', function(d,i,j) { return d3.rgb(barColor(d,i)).darker(j).toString(); }) + //.style('stroke', function(d,i,j) { return d3.rgb(barColor(d,i)).darker(j).toString(); }) + .style('fill', function(d,i,j) { return d3.rgb(barColor(d,i)).darker( disabled.map(function(d,i) { return i }).filter(function(d,i){ return !disabled[i] })[j] ).toString(); }) + .style('stroke', function(d,i,j) { return d3.rgb(barColor(d,i)).darker( disabled.map(function(d,i) { return i }).filter(function(d,i){ return !disabled[i] })[j] ).toString(); }); + } + + if (stacked) d3.transition(bars) .delay(function(d,i) { return i * delay / data[0].values.length }) @@ -5635,6 +5649,18 @@ nv.models.multiBar = function() { return chart; }; + chart.barColor = function(_) { + if (!arguments.length) return barColor; + barColor = nv.utils.getColor(_); + return chart; + }; + + chart.disabled = function(_) { + if (!arguments.length) return disabled; + disabled = _; + return chart; + }; + chart.id = function(_) { if (!arguments.length) return id; id = _; @@ -5790,6 +5816,11 @@ nv.models.multiBarChart = function() { if (showLegend) { legend.width(availableWidth / 2); + if (multibar.barColor()) + data.forEach(function(series,i) { + series.color = d3.rgb('#ccc').darker(i * 1.5).toString(); + }) + g.select('.nv-legendWrap') .datum(data) .call(legend); @@ -5833,6 +5864,7 @@ nv.models.multiBarChart = function() { // Main Chart Component(s) multibar + .disabled(data.map(function(series) { return series.disabled })) .width(availableWidth) .height(availableHeight) .color(data.map(function(d,i) { @@ -6002,7 +6034,7 @@ nv.models.multiBarChart = function() { chart.xAxis = xAxis; chart.yAxis = yAxis; - d3.rebind(chart, multibar, 'x', 'y', 'xDomain', 'yDomain', 'forceX', 'forceY', 'clipEdge', 'id', 'stacked', 'delay'); + d3.rebind(chart, multibar, 'x', 'y', 'xDomain', 'yDomain', 'forceX', 'forceY', 'clipEdge', 'id', 'stacked', 'delay', 'barColor'); chart.margin = function(_) { if (!arguments.length) return margin; @@ -6109,6 +6141,7 @@ nv.models.multiBarHorizontal = function() { , forceY = [0] // 0 is forced by default.. this makes sense for the majority of bar graphs... user can always do chart.forceY([]) to remove , color = nv.utils.defaultColor() , barColor = null // adding the ability to set the color for each rather than the whole group + , disabled // used in conjunction with barColor to communicate from multiBarHorizontalChart what series are disabled , stacked = false , showValues = false , valuePadding = 60 @@ -6329,7 +6362,14 @@ nv.models.multiBarHorizontal = function() { .attr('class', function(d,i) { return getY(d,i) < 0 ? 'nv-bar negative' : 'nv-bar positive'}) if (barColor) { - bars.style('fill', barColor).style('stroke', barColor); + if (!disabled) disabled = data.map(function() { return true }); + bars + //.style('fill', barColor) + //.style('stroke', barColor) + //.style('fill', function(d,i,j) { return d3.rgb(barColor(d,i)).darker(j).toString(); }) + //.style('stroke', function(d,i,j) { return d3.rgb(barColor(d,i)).darker(j).toString(); }) + .style('fill', function(d,i,j) { return d3.rgb(barColor(d,i)).darker( disabled.map(function(d,i) { return i }).filter(function(d,i){ return !disabled[i] })[j] ).toString(); }) + .style('stroke', function(d,i,j) { return d3.rgb(barColor(d,i)).darker( disabled.map(function(d,i) { return i }).filter(function(d,i){ return !disabled[i] })[j] ).toString(); }); } if (stacked) @@ -6462,6 +6502,12 @@ nv.models.multiBarHorizontal = function() { return chart; }; + chart.disabled = function(_) { + if (!arguments.length) return disabled; + disabled = _; + return chart; + }; + chart.id = function(_) { if (!arguments.length) return id; id = _; @@ -6634,6 +6680,11 @@ nv.models.multiBarHorizontalChart = function() { if (showLegend) { legend.width(availableWidth / 2); + if (multibar.barColor()) + data.forEach(function(series,i) { + series.color = d3.rgb('#ccc').darker(i * 1.5).toString(); + }) + g.select('.nv-legendWrap') .datum(data) .call(legend); @@ -6677,6 +6728,7 @@ nv.models.multiBarHorizontalChart = function() { // Main Chart Component(s) multibar + .disabled(data.map(function(series) { return series.disabled })) .width(availableWidth) .height(availableHeight) .color(data.map(function(d,i) { @@ -6829,7 +6881,7 @@ nv.models.multiBarHorizontalChart = function() { chart.xAxis = xAxis; chart.yAxis = yAxis; - d3.rebind(chart, multibar, 'x', 'y', 'xDomain', 'yDomain', 'forceX', 'forceY', 'clipEdge', 'id', 'delay', 'showValues', 'valueFormat', 'stacked'); + d3.rebind(chart, multibar, 'x', 'y', 'xDomain', 'yDomain', 'forceX', 'forceY', 'clipEdge', 'id', 'delay', 'showValues', 'valueFormat', 'stacked', 'barColor'); chart.margin = function(_) { if (!arguments.length) return margin; diff --git a/nv.d3.min.js b/nv.d3.min.js index 7edf6c3..2b6b37b 100644 --- a/nv.d3.min.js +++ b/nv.d3.min.js @@ -1,5 +1,5 @@ (function(){function c(a,b,c){return function(d,e,f){var g=a(d),h=[];g1)while(g=document.body.scrollWidth?m:m-16,l=window.innerHeight>=document.body.scrollHeight?l:l-16;var r=function(a){var b=q;do isNaN(a.offsetTop)||(b+=a.offsetTop);while(a=a.offsetParent);return b},s=function(a){var b=p;do isNaN(a.offsetLeft)||(b+=a.offsetLeft);while(a=a.offsetParent);return b};switch(d){case"e":p=b[0]-k-e,q=b[1]-j/2;var t=s(h),u=r(h);to?b[0]+e:o-t+p),un+m&&(q=n+m-u+q-j);break;case"w":p=b[0]+e,q=b[1]-j/2,t+k>l&&(p=b[0]-k-e),un+m&&(q=n-j-5);break;case"n":p=b[0]-k/2-5,q=b[1]+e;var t=s(h),u=r(h);tl&&(p=p-k/2+5),u+j>n+m&&(q=n+m-u+q-j);break;case"s":p=b[0]-k/2,q=b[1]-j-e;var t=s(h),u=r(h);tl&&(p=p-k/2+5),n>u&&(q=n)}h.style.left=p+"px",h.style.top=q+"px",h.style.opacity=1,h.style.position="absolute",h.style.pointerEvents="none";return h},b.cleanup=function(){var a=document.getElementsByClassName("nvtooltip"),b=[];while(a.length)b.push(a[0]),a[0].style.transitionDelay="0 !important",a[0].style.opacity=0,a[0].className="nvtooltip-pending-removal";setTimeout(function(){while(b.length){var a=b.pop();a.parentNode.removeChild(a)}},500)}}(),a.utils.windowSize=function(){var a={width:640,height:480};document.body&&document.body.offsetWidth&&(a.width=document.body.offsetWidth,a.height=document.body.offsetHeight),document.compatMode=="CSS1Compat"&&document.documentElement&&document.documentElement.offsetWidth&&(a.width=document.documentElement.offsetWidth,a.height=document.documentElement.offsetHeight),window.innerWidth&&window.innerHeight&&(a.width=window.innerWidth,a.height=window.innerHeight);return a},a.utils.windowResize=function(a){var b=window.onresize;window.onresize=function(c){typeof b=="function"&&b(c),a(c)}},a.utils.getColor=function(b){if(!arguments.length)return a.utils.defaultColor();return Object.prototype.toString.call(b)==="[object Array]"?function(a,c){return a.color||b[c%b.length]}:b},a.utils.defaultColor=function(){var a=d3.scale.category20().range();return function(b,c){return b.color||a[c%a.length]}},a.utils.customTheme=function(a,b,c){b=b||function(a){return a.key},c=c||d3.scale.category20().range();var d=c.length;return function(e,f){var g=b(e);d||(d=c.length);return typeof a[g]!="undefined"?typeof a[g]=="function"?a[g]():a[g]:c[--d]}},a.utils.pjax=function(b,c){function d(d){d3.html(d,function(d){var e=d3.select(c).node();e.parentNode.replaceChild(d3.select(d).select(c).node(),e),a.utils.pjax(b,c)})}d3.selectAll(b).on("click",function(){history.pushState(this.href,this.textContent,this.href),d(this.href),d3.event.preventDefault()}),d3.select(window).on("popstate",function(){d3.event.state&&d(d3.event.state)})},a.models.axis=function(){function o(d){d.each(function(d){var o=d3.select(this),p=o.selectAll("g.nv-wrap.nv-axis").data([d]),q=p.enter().append("g").attr("class","nvd3 nv-wrap nv-axis"),r=q.append("g"),s=p.select("g");m!==null?a.ticks(m):(a.orient()=="top"||a.orient()=="bottom")&&a.ticks(Math.abs(e.range()[1]-e.range()[0])/100),d3.transition(s).call(a),n=n||a.scale();var t=a.tickFormat();t==null&&(t=n.tickFormat());var u=s.selectAll("text.nv-axislabel").data([f||null]);u.exit().remove();switch(a.orient()){case"top":u.enter().append("text").attr("class","nv-axislabel").attr("text-anchor","middle").attr("y",0);var v=e.range().length==2?e.range()[1]:e.range()[e.range().length-1]+(e.range()[1]-e.range()[0]);u.attr("x",v/2);if(g){var w=p.selectAll("g.nv-axisMaxMin").data(e.domain());w.enter().append("g").attr("class","nv-axisMaxMin").append("text"),w.exit().remove(),w.attr("transform",function(a,b){return"translate("+e(a)+",0)"}).select("text").attr("dy","0em").attr("y",-a.tickPadding()).attr("text-anchor","middle").text(function(a,b){var c=t(a);return(""+c).match("NaN")?"":c}),d3.transition(w).attr("transform",function(a,b){return"translate("+e.range()[b]+",0)"})}break;case"bottom":var x=36,y=30,z=s.selectAll("g").select("text");if(i%360){z.each(function(a,b){var c=this.getBBox().width;c>y&&(y=c)});var A=Math.abs(Math.sin(i*Math.PI/180)),x=(A?A*y:y)+30;z.attr("transform",function(a,b,c){return"rotate("+i+" 0,0)"}).attr("text-anchor",i%360>0?"start":"end")}u.enter().append("text").attr("class","nv-axislabel").attr("text-anchor","middle").attr("y",x);var v=e.range().length==2?e.range()[1]:e.range()[e.range().length-1]+(e.range()[1]-e.range()[0]);u.attr("x",v/2);if(g){var w=p.selectAll("g.nv-axisMaxMin").data([e.domain()[0],e.domain()[e.domain().length-1]]);w.enter().append("g").attr("class","nv-axisMaxMin").append("text"),w.exit().remove(),w.attr("transform",function(a,b){return"translate("+(e(a)+(l?e.rangeBand()/2:0))+",0)"}).select("text").attr("dy",".71em").attr("y",a.tickPadding()).attr("transform",function(a,b,c){return"rotate("+i+" 0,0)"}).attr("text-anchor",i?i%360>0?"start":"end":"middle").text(function(a,b){var c=t(a);return(""+c).match("NaN")?"":c}),d3.transition(w).attr("transform",function(a,b){return"translate("+(e(a)+(l?e.rangeBand()/2:0))+",0)"})}k&&z.attr("transform",function(a,b){return"translate(0,"+(b%2==0?"0":"12")+")"});break;case"right":u.enter().append("text").attr("class","nv-axislabel").attr("text-anchor",j?"middle":"begin").attr("transform",j?"rotate(90)":"").attr("y",j?-Math.max(b.right,c)+12:-10),u.attr("x",j?e.range()[0]/2:a.tickPadding());if(g){var w=p.selectAll("g.nv-axisMaxMin").data(e.domain());w.enter().append("g").attr("class","nv-axisMaxMin").append("text").style("opacity",0),w.exit().remove(),w.attr("transform",function(a,b){return"translate(0,"+e(a)+")"}).select("text").attr("dy",".32em").attr("y",0).attr("x",a.tickPadding()).attr("text-anchor","start").text(function(a,b){var c=t(a);return(""+c).match("NaN")?"":c}),d3.transition(w).attr("transform",function(a,b){return"translate(0,"+e.range()[b]+")"}).select("text").style("opacity",1)}break;case"left":u.enter().append("text").attr("class","nv-axislabel").attr("text-anchor",j?"middle":"end").attr("transform",j?"rotate(-90)":"").attr("y",j?-Math.max(b.left,c)+12:-10),u.attr("x",j?-e.range()[0]/2:-a.tickPadding());if(g){var w=p.selectAll("g.nv-axisMaxMin").data(e.domain());w.enter().append("g").attr("class","nv-axisMaxMin").append("text").style("opacity",0),w.exit().remove(),w.attr("transform",function(a,b){return"translate(0,"+n(a)+")"}).select("text").attr("dy",".32em").attr("y",0).attr("x",-a.tickPadding()).attr("text-anchor","end").text(function(a,b){var c=t(a);return(""+c).match("NaN")?"":c}),d3.transition(w).attr("transform",function(a,b){return"translate(0,"+e.range()[b]+")"}).select("text").style("opacity",1)}}u.text(function(a){return a}),g&&(a.orient()==="left"||a.orient()==="right")&&(s.selectAll("g").each(function(a,b){d3.select(this).select("text").attr("opacity",1);if(e(a)e.range()[0]-10)(a>1e-10||a<-1e-10)&&d3.select(this).attr("opacity",0),d3.select(this).select("text").attr("opacity",0)}),e.domain()[0]==e.domain()[1]&&e.domain()[0]==0&&p.selectAll("g.nv-axisMaxMin").style("opacity",function(a,b){return b?0:1}));if(g&&(a.orient()==="top"||a.orient()==="bottom")){var B=[];p.selectAll("g.nv-axisMaxMin").each(function(a,b){try{b?B.push(e(a)-this.getBBox().width-4):B.push(e(a)+this.getBBox().width+4)}catch(c){b?B.push(e(a)-4):B.push(e(a)+4)}}),s.selectAll("g").each(function(a,b){if(e(a)B[1])a>1e-10||a<-1e-10?d3.select(this).remove():d3.select(this).select("text").remove()})}h&&s.selectAll("line.tick").filter(function(a){return!parseFloat(Math.round(a*1e5)/1e6)}).classed("zero",!0),n=e.copy()});return o}var a=d3.svg.axis(),b={top:0,right:0,bottom:0,left:0},c=75,d=60,e=d3.scale.linear(),f=null,g=!0,h=!0,i=0,j=!0,k=!1,l=!1,m=null;a.scale(e).orient("bottom").tickFormat(function(a){return a});var n;o.axis=a,d3.rebind(o,a,"orient","tickValues","tickSubdivide","tickSize","tickPadding","tickFormat"),d3.rebind(o,e,"domain","range","rangeBand","rangeBands"),o.margin=function(a){if(!arguments.length)return b;b.top=typeof a.top!="undefined"?a.top:b.top,b.right=typeof a.right!="undefined"?a.right:b.right,b.bottom=typeof a.bottom!="undefined"?a.bottom:b.bottom,b.left=typeof a.left!="undefined"?a.left:b.left;return o},o.width=function(a){if(!arguments.length)return c;c=a;return o},o.ticks=function(a){if(!arguments.length)return m;m=a;return o},o.height=function(a){if(!arguments.length)return d;d=a;return o},o.axisLabel=function(a){if(!arguments.length)return f;f=a;return o},o.showMaxMin=function(a){if(!arguments.length)return g;g=a;return o},o.highlightZero=function(a){if(!arguments.length)return h;h=a;return o},o.scale=function(b){if(!arguments.length)return e;e=b,a.scale(e),l=typeof e.rangeBands=="function",d3.rebind(o,e,"domain","range","rangeBand","rangeBands");return o},o.rotateYLabel=function(a){if(!arguments.length)return j;j=a;return o},o.rotateLabels=function(a){if(!arguments.length)return i;i=a;return o},o.staggerLabels=function(a){if(!arguments.length)return k;k=a;return o};return o},a.models.historicalBar=function(){function r(a){a.each(function(a){var r=c-b.left-b.right,s=d-b.top-b.bottom,t=d3.select(this);f.domain(o||d3.extent(a[0].values.map(h).concat(j))),l?f.range([r*.5/a[0].values.length,r*(a[0].values.length-.5)/a[0].values.length]):f.range([0,r]),g.domain(p||d3.extent(a[0].values.map(i).concat(k))).range([s,0]);if(f.domain()[0]===f.domain()[1]||g.domain()[0]===g.domain()[1])singlePoint=!0;f.domain()[0]===f.domain()[1]&&(f.domain()[0]?f.domain([f.domain()[0]-f.domain()[0]*.01,f.domain()[1]+f.domain()[1]*.01]):f.domain([-1,1])),g.domain()[0]===g.domain()[1]&&(g.domain()[0]?g.domain([g.domain()[0]+g.domain()[0]*.01,g.domain()[1]-g.domain()[1]*.01]):g.domain([-1,1]));var u=t.selectAll("g.nv-wrap.nv-bar").data([a[0].values]),v=u.enter().append("g").attr("class","nvd3 nv-wrap nv-bar"),w=v.append("defs"),z=v.append("g"),A=u.select("g");z.append("g").attr("class","nv-bars"),u.attr("transform","translate("+b.left+","+b.top+")"),t.on("click",function(a,b){q.chartClick({data:a,index:b,pos:d3.event,id:e})}),w.append("clipPath").attr("id","nv-chart-clip-path-"+e).append("rect"),u.select("#nv-chart-clip-path-"+e+" rect").attr("width",r).attr("height",s),A.attr("clip-path",m?"url(#nv-chart-clip-path-"+e+")":"");var B=u.select(".nv-bars").selectAll(".nv-bar").data(function(a){return a});B.exit().remove();var C=B.enter().append("rect").attr("x",0).attr("y",function(a,b){return g(Math.max(0,i(a,b)))}).attr("height",function(a,b){return Math.abs(g(i(a,b))-g(0))}).on("mouseover",function(b,c){d3.select(this).classed("hover",!0),q.elementMouseover({point:b,series:a[0],pos:[f(h(b,c)),g(i(b,c))],pointIndex:c,seriesIndex:0,e:d3.event})}).on("mouseout",function(b,c){d3.select(this).classed("hover",!1),q.elementMouseout({point:b,series:a[0],pointIndex:c,seriesIndex:0,e:d3.event})}).on("click",function(a,b){q.elementClick({value:i(a,b),data:a,index:b,pos:[f(h(a,b)),g(i(a,b))],e:d3.event,id:e}),d3.event.stopPropagation()}).on("dblclick",function(a,b){q.elementDblClick({value:i(a,b),data:a,index:b,pos:[f(h(a,b)),g(i(a,b))],e:d3.event,id:e}),d3.event.stopPropagation()});B.attr("fill",function(a,b){return n(a,b)}).attr("class",function(a,b,c){return(i(a,b)<0?"nv-bar negative":"nv-bar positive")+" nv-bar-"+c+"-"+b}).attr("transform",function(b,c){return"translate("+(f(h(b,c))-r/a[0].values.length*.45)+",0)"}).attr("width",r/a[0].values.length*.9),d3.transition(B).attr("y",function(a,b){return i(a,b)<0?g(0):g(0)-g(i(a,b))<1?g(0)-1:g(i(a,b))}).attr("height",function(a,b){return Math.max(Math.abs(g(i(a,b))-g(0)),1)})});return r}var b={top:0,right:0,bottom:0,left:0},c=960,d=500,e=Math.floor(Math.random()*1e4),f=d3.scale.linear(),g=d3.scale.linear(),h=function(a){return a.x},i=function(a){return a.y},j=[],k=[0],l=!1,m=!0,n=a.utils.defaultColor(),o,p,q=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout");r.dispatch=q,r.x=function(a){if(!arguments.length)return h;h=a;return r},r.y=function(a){if(!arguments.length)return i;i=a;return r},r.margin=function(a){if(!arguments.length)return b;b.top=typeof a.top!="undefined"?a.top:b.top,b.right=typeof a.right!="undefined"?a.right:b.right,b.bottom=typeof a.bottom!="undefined"?a.bottom:b.bottom,b.left=typeof a.left!="undefined"?a.left:b.left;return r},r.width=function(a){if(!arguments.length)return c;c=a;return r},r.height=function(a){if(!arguments.length)return d;d=a;return r},r.xScale=function(a){if(!arguments.length)return f;f=a;return r},r.yScale=function(a){if(!arguments.length)return g;g=a;return r},r.xDomain=function(a){if(!arguments.length)return o;o=a;return r},r.yDomain=function(a){if(!arguments.length)return p;p=a;return r},r.forceX=function(a){if(!arguments.length)return j;j=a;return r},r.forceY=function(a){if(!arguments.length)return k;k=a;return r},r.padData=function(a){if(!arguments.length)return l;l=a;return r},r.clipEdge=function(a){if(!arguments.length)return m;m=a;return r},r.color=function(b){if(!arguments.length)return n;n=a.utils.getColor(b);return r},r.id=function(a){if(!arguments.length)return e;e=a;return r};return r},a.models.bullet=function(){function n(a){a.each(function(a,c){var k=i-b.left-b.right,n=j-b.top-b.bottom,o=d3.select(this),p=e.call(this,a,c).slice().sort(d3.descending),q=f.call(this,a,c).slice().sort(d3.descending),r=g.call(this,a,c).slice().sort(d3.descending),s=d3.scale.linear().domain(d3.extent(d3.merge([h,p]))).range(d?[k,0]:[0,k]),t=this.__chart__||d3.scale.linear().domain([0,Infinity]).range(s.range());this.__chart__=s;var u=d3.min(p),v=d3.max(p),w=p[1],x=o.selectAll("g.nv-wrap.nv-bullet").data([a]),y=x.enter().append("g").attr("class","nvd3 nv-wrap nv-bullet"),z=y.append("g"),A=x.select("g");z.append("rect").attr("class","nv-range nv-rangeMax"),z.append("rect").attr("class","nv-range nv-rangeAvg"),z.append("rect").attr("class","nv-range nv-rangeMin"),z.append("rect").attr("class","nv-measure"),z.append("path").attr("class","nv-markerTriangle"),x.attr("transform","translate("+b.left+","+b.top+")");var B=function(a){return Math.abs(t(a)-t(0))},C=function(a){return Math.abs(s(a)-s(0))},D=function(a){return a<0?t(a):t(0)},E=function(a){return a<0?s(a):s(0)};A.select("rect.nv-rangeMax").attr("height",n).attr("width",C(v>0?v:u)).attr("x",E(v>0?v:u)).datum(v>0?v:u),A.select("rect.nv-rangeAvg").attr("height",n).attr("width",C(w)).attr("x",E(w)).datum(w),A.select("rect.nv-rangeMin").attr("height",n).attr("width",C(v)).attr("x",E(v)).attr("width",C(v>0?u:v)).attr("x",E(v>0?u:v)).datum(v>0?u:v),A.select("rect.nv-measure").style("fill",l).attr("height",n/3).attr("y",n/3).attr("width",r<0?s(0)-s(r[0]):s(r[0])-s(0)).attr("x",E(r)).on("mouseover",function(){m.elementMouseover({value:r[0],label:"Current",pos:[s(r[0]),n/2]})}).on("mouseout",function(){m.elementMouseout({value:r[0],label:"Current"})});var F=n/6;q[0]?A.selectAll("path.nv-markerTriangle").attr("transform",function(a){return"translate("+s(q[0])+","+n/2+")"}).attr("d","M0,"+F+"L"+F+","+ -F+" "+ -F+","+ -F+"Z").on("mouseover",function(){m.elementMouseover({value:q[0],label:"Previous",pos:[s(q[0]),n/2]})}).on("mouseout",function(){m.elementMouseout({value:q[0],label:"Previous"})}):A.selectAll("path.nv-markerTriangle").remove(),x.selectAll(".nv-range").on("mouseover",function(a,b){var c=b?b==1?"Mean":"Minimum":"Maximum";m.elementMouseover({value:a,label:c,pos:[s(a),n/2]})}).on("mouseout",function(a,b){var c=b?b==1?"Mean":"Minimum":"Maximum";m.elementMouseout({value:a,label:c})})});return n}var b={top:0,right:0,bottom:0,left:0},c="left",d=!1,e=function(a){return a.ranges},f=function(a){return a.markers},g=function(a){return a.measures},h=[0],i=380,j=30,k=null,l=a.utils.getColor(["#1f77b4"]),m=d3.dispatch("elementMouseover","elementMouseout");n.dispatch=m,n.orient=function(a){if(!arguments.length)return c;c=a,d=c=="right"||c=="bottom";return n},n.ranges=function(a){if(!arguments.length)return e;e=a;return n},n.markers=function(a){if(!arguments.length)return f;f=a;return n},n.measures=function(a){if(!arguments.length)return g;g=a;return n},n.forceX=function(a){if(!arguments.length)return h;h=a;return n},n.width=function(a){if(!arguments.length)return i;i=a;return n},n.height=function(a){if(!arguments.length)return j;j=a;return n},n.margin=function(a){if(!arguments.length)return b;b.top=typeof a.top!="undefined"?a.top:b.top,b.right=typeof a.right!="undefined"?a.right:b.right,b.bottom=typeof a.bottom!="undefined"?a.bottom:b.bottom,b.left=typeof a.left!="undefined"?a.left:b.left;return n},n.tickFormat=function(a){if(!arguments.length)return k;k=a;return n},n.color=function(b){if(!arguments.length)return l;l=a.utils.getColor(b);return n};return n},a.models.bulletChart=function(){function q(a){a.each(function(c,m){var r=d3.select(this),s=(i||parseInt(r.style("width"))||960)-e.left-e.right,t=j-e.top-e.bottom,u=this;q.update=function(){q(a)},q.container=this;if(!c||!f.call(this,c,m)){var v=r.selectAll(".nv-noData").data([n]);v.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),v.attr("x",e.left+s/2).attr("y",18+e.top+t/2).text(function(a){return a});return q}r.selectAll(".nv-noData").remove();var w=f.call(this,c,m).slice().sort(d3.descending),x=g.call(this,c,m).slice().sort(d3.descending),y=h.call(this,c,m).slice().sort(d3.descending),z=r.selectAll("g.nv-wrap.nv-bulletChart").data([c]),A=z.enter().append("g").attr("class","nvd3 nv-wrap nv-bulletChart"),B=A.append("g"),C=z.select("g");B.append("g").attr("class","nv-bulletWrap"),B.append("g").attr("class","nv-titles"),z.attr("transform","translate("+e.left+","+e.top+")");var D=d3.scale.linear().domain([0,Math.max(w[0],x[0],y[0])]).range(d?[s,0]:[0,s]),E=this.__chart__||d3.scale.linear().domain([0,Infinity]).range(D.range());this.__chart__=D;var F=function(a){return Math.abs(E(a)-E(0))},G=function(a){return Math.abs(D(a)-D(0))},H=B.select(".nv-titles").append("g").attr("text-anchor","end").attr("transform","translate(-6,"+(j-e.top-e.bottom)/2+")");H.append("text").attr("class","nv-title").text(function(a){return a.title}),H.append("text").attr("class","nv-subtitle").attr("dy","1em").text(function(a){return a.subtitle}),b.width(s).height(t);var I=C.select(".nv-bulletWrap");d3.transition(I).call(b);var J=k||D.tickFormat(s/100),K=C.selectAll("g.nv-tick").data(D.ticks(s/50),function(a){return this.textContent||J(a)}),L=K.enter().append("g").attr("class","nv-tick").attr("transform",function(a){return"translate("+E(a)+",0)"}).style("opacity",1e-6);L.append("line").attr("y1",t).attr("y2",t*7/6),L.append("text").attr("text-anchor","middle").attr("dy","1em").attr("y",t*7/6).text(J);var M=d3.transition(K).attr("transform",function(a){return"translate("+D(a)+",0)"}).style("opacity",1);M.select("line").attr("y1",t).attr("y2",t*7/6),M.select("text").attr("y",t*7/6),d3.transition(K.exit()).attr("transform",function(a){return"translate("+D(a)+",0)"}).style("opacity",1e-6).remove(),o.on("tooltipShow",function(a){a.key=data[0].title,l&&p(a,u.parentNode)})}),d3.timer.flush();return q}var b=a.models.bullet(),c="left",d=!1,e={top:5,right:40,bottom:20,left:120},f=function(a){return a.ranges},g=function(a){return a.markers},h=function(a){return a.measures},i=null,j=55,k=null,l=!0,m=function(a,b,c,d,e){return"

"+b+"

"+"

"+c+"

"},n="No Data Available.",o=d3.dispatch("tooltipShow","tooltipHide"),p=function(b,c){var d=b.pos[0]+(c.offsetLeft||0)+e.left,f=b.pos[1]+(c.offsetTop||0)+e.top,g=m(b.key,b.label,b.value,b,q);a.tooltip.show([d,f],g,b.value<0?"e":"w",null,c)};b.dispatch.on("elementMouseover.tooltip",function(a){o.tooltipShow(a)}),b.dispatch.on("elementMouseout.tooltip",function(a){o.tooltipHide(a)}),o.on("tooltipHide",function(){l&&a.tooltip.cleanup()}),q.dispatch=o,q.bullet=b,d3.rebind(q,b,"color"),q.orient=function(a){if(!arguments.length)return c;c=a,d=c=="right"||c=="bottom";return q},q.ranges=function(a){if(!arguments.length)return f;f=a;return q},q.markers=function(a){if(!arguments.length)return g;g=a;return q},q.measures=function(a){if(!arguments.length)return h;h=a;return q},q.width=function(a){if(!arguments.length)return i;i=a;return q},q.height=function(a){if(!arguments.length)return j;j=a;return q},q.margin=function(a){if(!arguments.length)return e;e.top=typeof a.top!="undefined"?a.top:e.top,e.right=typeof a.right!="undefined"?a.right:e.right,e.bottom=typeof a.bottom!="undefined"?a.bottom:e.bottom,e.left=typeof a.left!="undefined"?a.left:e.left;return q},q.tickFormat=function(a){if(!arguments.length)return k;k=a;return q},q.tooltips=function(a){if(!arguments.length)return l;l=a;return q},q.tooltipContent=function(a){if(!arguments.length)return m;m=a;return q},q.noData=function(a){if(!arguments.length)return n;n=a;return q};return q},a.models.cumulativeLineChart=function(){function z(a,c){return c.map(function(c,d){var e=b.y()(c.values[a],a);if(e<-0.95){c.tempDisabled=!0;return c}c.tempDisabled=!1,c.values=c.values.map(function(a,c){a.display={y:(b.y()(a,c)-e)/(1+e)};return a});return c})}function y(a){a.each(function(o){function S(){R.data([w]),y.update()}function H(a,b){d3.select(y.container).style("cursor","auto"),s.index=w.i,u.stateChange(s)}function G(a,b){w.x=d3.event.x,w.i=Math.round(v.invert(w.x)),S()}function F(a,b){d3.select(y.container).style("cursor","ew-resize")}var A=d3.select(this).classed("nv-chart-"+r,!0),B=this,C=(i||parseInt(A.style("width"))||960)-g.left-g.right,D=(j||parseInt(A.style("height"))||400)-g.top-g.bottom;y.update=function(){y(a)},y.container=this;var E=d3.behavior.drag().on("dragstart",F).on("drag",G).on("dragend",H);if(!o||!o.length||!o.filter(function(a){return a.values.length}).length){var I=A.selectAll(".nv-noData").data([t]);I.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),I.attr("x",g.left+C/2).attr("y",g.top+D/2).text(function(a){return a});return y}A.selectAll(".nv-noData").remove(),p=b.xScale(),q=b.yScale();if(!n){var J=o.filter(function(a){return!a.disabled}).map(function(a,c){var d=d3.extent(a.values,b.y());d[0]<-0.95&&(d[0]=-0.95);return[(d[0]-d[1])/(1+d[1]),(d[1]-d[0])/(1+d[0])]}),K=[d3.min(J,function(a){return a[0]}),d3.max(J,function(a){return a[1]})];b.yDomain(K)}else b.yDomain(null);v.domain([0,o[0].values.length-1]).range([0,C]).clamp(!0);var o=z(w.i,o),L=A.selectAll("g.nv-wrap.nv-cumulativeLine").data([o]),M=L.enter().append("g").attr("class","nvd3 nv-wrap nv-cumulativeLine").append("g"),N=L.select("g");M.append("g").attr("class","nv-x nv-axis"),M.append("g").attr("class","nv-y nv-axis"),M.append("g").attr("class","nv-background"),M.append("g").attr("class","nv-linesWrap"),M.append("g").attr("class","nv-legendWrap"),M.append("g").attr("class","nv-controlsWrap"),k&&(e.width(C),N.select(".nv-legendWrap").datum(o).call(e),g.top!=e.height()&&(g.top=e.height(),D=(j||parseInt(A.style("height"))||400)-g.top-g.bottom),N.select(".nv-legendWrap").attr("transform","translate(0,"+ -g.top+")"));if(m){var O=[{key:"Re-scale y-axis",disabled:!n}];f.width(140).color(["#444","#444","#444"]),N.select(".nv-controlsWrap").datum(O).attr("transform","translate(0,"+ -g.top+")").call(f)}L.attr("transform","translate("+g.left+","+g.top+")");var P=o.filter(function(a){return a.tempDisabled});L.select(".tempDisabled").remove(),P.length&&L.append("text").attr("class","tempDisabled").attr("x",C/2).attr("y","-.71em").style("text-anchor","end").text(P.map(function(a){return a.key}).join(", ")+" values cannot be calculated for this time period."),M.select(".nv-background").append("rect"),N.select(".nv-background rect").attr("width",C).attr("height",D),b.y(function(a){return a.display.y}).width(C).height(D).color(o.map(function(a,b){return a.color||h(a,b)}).filter(function(a,b){return!o[b].disabled&&!o[b].tempDisabled}));var Q=N.select(".nv-linesWrap").datum(o.filter(function(a){return!a.disabled&&!a.tempDisabled}));Q.call(b);var R=Q.selectAll(".nv-indexLine").data([w]);R.enter().append("rect").attr("class","nv-indexLine").attr("width",3).attr("x",-2).attr("fill","red").attr("fill-opacity",.5).call(E),R.attr("transform",function(a){return"translate("+v(a.i)+",0)"}).attr("height",D),c.scale(p).ticks(Math.min(o[0].values.length,C/70)).tickSize(-D,0),N.select(".nv-x.nv-axis").attr("transform","translate(0,"+q.range()[0]+")"),d3.transition(N.select(".nv-x.nv-axis")).call(c),d.scale(q).ticks(D/36).tickSize(-C,0),d3.transition(N.select(".nv-y.nv-axis")).call(d),N.select(".nv-background rect").on("click",function(){w.x=d3.mouse(this)[0],w.i=Math.round(v.invert(w.x)),s.index=w.i,u.stateChange(s),S()}),b.dispatch.on("elementClick",function(a){w.i=a.pointIndex,w.x=v(w.i),s.index=w.i,u.stateChange(s),S()}),f.dispatch.on("legendClick",function(b,c){b.disabled=!b.disabled,n=!b.disabled,s.rescaleY=n,u.stateChange(s),a.call(y)}),e.dispatch.on("legendClick",function(b,c){b.disabled=!b.disabled,o.filter(function(a){return!a.disabled}).length||o.map(function(a){a.disabled=!1,L.selectAll(".nv-series").classed("disabled",!1);return a}),s.disabled=o.map(function(a){return!!a.disabled}),u.stateChange(s),a.call(y)}),u.on("tooltipShow",function(a){l&&x(a,B.parentNode)}),u.on("changeState",function(b){typeof b.disabled!="undefined"&&(o.forEach(function(a,c){a.disabled=b.disabled[c]}),s.disabled=b.disabled),typeof b.index!="undefined"&&(w.i=b.index,w.x=v(w.i),s.index=b.index,R.data([w])),typeof b.rescaleY!="undefined"&&(n=b.rescaleY),a.call(y)})});return y}var b=a.models.line(),c=a.models.axis(),d=a.models.axis(),e=a.models.legend(),f=a.models.legend(),g={top:30,right:30,bottom:50,left:60},h=a.utils.defaultColor(),i=null,j=null,k=!0,l=!0,m=!0,n=!0,o=function(a,b,c,d,e){return"

"+a+"

"+"

"+c+" at "+b+"

"},p,q,r=b.id(),s={index:0,rescaleY:n},t="No Data Available.",u=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState");c.orient("bottom").tickPadding(7),d.orient("left");var v=d3.scale.linear(),w={i:0,x:0},x=function(e,f){var g=e.pos[0]+(f.offsetLeft||0),h=e.pos[1]+(f.offsetTop||0),i=c.tickFormat()(b.x()(e.point,e.pointIndex)),j=d.tickFormat()(b.y()(e.point,e.pointIndex)),k=o(e.series.key,i,j,e,y);a.tooltip.show([g,h],k,null,null,f)};b.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+g.left,a.pos[1]+g.top],u.tooltipShow(a)}),b.dispatch.on("elementMouseout.tooltip",function(a){u.tooltipHide(a)}),u.on("tooltipHide",function(){l&&a.tooltip.cleanup()}),y.dispatch=u,y.lines=b,y.legend=e,y.xAxis=c,y.yAxis=d,d3.rebind(y,b,"defined","isArea","x","y","size","xDomain","yDomain","forceX","forceY","interactive","clipEdge","clipVoronoi","id"),y.margin=function(a){if(!arguments.length)return g;g.top=typeof a.top!="undefined"?a.top:g.top,g.right=typeof a.right!="undefined"?a.right:g.right,g.bottom=typeof a.bottom!="undefined"?a.bottom:g.bottom,g.left=typeof a.left!="undefined"?a.left:g.left;return y},y.width=function(a){if(!arguments.length)return i;i=a;return y},y.height=function(a){if(!arguments.length)return j;j=a;return y},y.color=function(b){if(!arguments.length)return h;h=a.utils.getColor(b),e.color(h);return y},y.rescaleY=function(a){if(!arguments.length)return n;n=a;return n},y.showControls=function(a){if(!arguments.length)return m;m=a;return y},y.showLegend=function(a){if(!arguments.length)return k;k=a;return y},y.tooltips=function(a){if(!arguments.length)return l;l=a;return y},y.tooltipContent=function(a){if(!arguments.length)return o;o=a;return y},y.state=function(a){if(!arguments.length)return s;s=a;return y},y.noData=function(a){if(!arguments.length)return t;t=a;return y};return y},a.models.discreteBar=function(){function t(a){a.each(function(a){var e=c-b.left-b.right,t=d-b.top-b.bottom,u=d3.select(this);a=a.map(function(a,b){a.values=a.values.map(function(a){a.series=b;return a});return a});var v=n&&o?[]:a.map(function(a){return a.values.map(function(a,b){return{x:h(a,b),y:i(a,b),y0:a.y0}})});f.domain(n||d3.merge(v).map(function(a){return a.x})).rangeBands([0,e],.1),g.domain(o||d3.extent(d3.merge(v).map(function(a){return a.y}).concat(j))),l?g.range([t-(g.domain()[0]<0?12:0),g.domain()[1]>0?12:0]):g.range([t,0]),r=r||f,s=s||g.copy().range([g(0),g(0)]);var w=u.selectAll("g.nv-wrap.nv-discretebar").data([a]),z=w.enter().append("g").attr("class","nvd3 nv-wrap nv-discretebar"),A=z.append("g"),B=w.select("g");A.append("g").attr("class","nv-groups"),w.attr("transform","translate("+b.left+","+b.top+")");var C=w.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a){return a.key});C.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),d3.transition(C.exit()).style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),C.attr("class",function(a,b){return"nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}),d3.transition(C).style("stroke-opacity",1).style("fill-opacity",.75);var D=C.selectAll("g.nv-bar").data(function(a){return a.values});D.exit().remove();var E=D.enter().append("g").attr("transform",function(a,b,c){return"translate("+(f(h(a,b))+f.rangeBand()*.05)+", "+g(0)+")"}).on("mouseover",function(b,c){d3.select(this).classed("hover",!0),p.elementMouseover({value:i(b,c),point:b,series:a[b.series],pos:[f(h(b,c))+f.rangeBand()*(b.series+.5)/a.length,g(i(b,c))],pointIndex:c,seriesIndex:b.series,e:d3.event})}).on("mouseout",function(b,c){d3.select(this).classed("hover",!1),p.elementMouseout({value:i(b,c),point:b,series:a[b.series],pointIndex:c,seriesIndex:b.series,e:d3.event})}).on("click",function(b,c){p.elementClick({value:i(b,c),point:b,series:a[b.series],pos:[f(h(b,c))+f.rangeBand()*(b.series+.5)/a.length,g(i(b,c))],pointIndex:c,seriesIndex:b.series,e:d3.event}),d3.event.stopPropagation()}).on("dblclick",function(b,c){p.elementDblClick({value:i(b,c),point:b,series:a[b.series],pos:[f(h(b,c))+f.rangeBand()*(b.series+.5)/a.length,g(i(b,c))],pointIndex:c,seriesIndex:b.series,e:d3.event}),d3.event.stopPropagation()});E.append("rect").attr("height",0).attr("width",f.rangeBand()*.9/a.length),l?(E.append("text").attr("text-anchor","middle"),D.select("text").attr("x",f.rangeBand()*.9/2).attr("y",function(a,b){return i(a,b)<0?g(i(a,b))-g(0)+12:-4}).text(function(a,b){return m(i(a,b))})):D.selectAll("text").remove(),D.attr("class",function(a,b){return i(a,b)<0?"nv-bar negative":"nv-bar positive"}).style("fill",function(a,b){return a.color||k(a,b)}).style("stroke",function(a,b){return a.color||k(a,b)}).select("rect").attr("class",q).attr("width",f.rangeBand()*.9/a.length),d3.transition(D).attr("transform",function(a,b){var c=f(h(a,b))+f.rangeBand()*.05,d=i(a,b)<0?g(0):g(0)-g(i(a,b))<1?g(0)-1:g(i(a,b));return"translate("+c+", "+d+")"}).select("rect").attr("height",function(a,b){return Math.max(Math.abs(g(i(a ,b))-g(0))||1)}),r=f.copy(),s=g.copy()});return t}var b={top:0,right:0,bottom:0,left:0},c=960,d=500,e=Math.floor(Math.random()*1e4),f=d3.scale.ordinal(),g=d3.scale.linear(),h=function(a){return a.x},i=function(a){return a.y},j=[0],k=a.utils.defaultColor(),l=!1,m=d3.format(",.2f"),n,o,p=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout"),q="discreteBar",r,s;t.dispatch=p,t.x=function(a){if(!arguments.length)return h;h=a;return t},t.y=function(a){if(!arguments.length)return i;i=a;return t},t.margin=function(a){if(!arguments.length)return b;b.top=typeof a.top!="undefined"?a.top:b.top,b.right=typeof a.right!="undefined"?a.right:b.right,b.bottom=typeof a.bottom!="undefined"?a.bottom:b.bottom,b.left=typeof a.left!="undefined"?a.left:b.left;return t},t.width=function(a){if(!arguments.length)return c;c=a;return t},t.height=function(a){if(!arguments.length)return d;d=a;return t},t.xScale=function(a){if(!arguments.length)return f;f=a;return t},t.yScale=function(a){if(!arguments.length)return g;g=a;return t},t.xDomain=function(a){if(!arguments.length)return n;n=a;return t},t.yDomain=function(a){if(!arguments.length)return o;o=a;return t},t.forceY=function(a){if(!arguments.length)return j;j=a;return t},t.color=function(b){if(!arguments.length)return k;k=a.utils.getColor(b);return t},t.id=function(a){if(!arguments.length)return e;e=a;return t},t.showValues=function(a){if(!arguments.length)return l;l=a;return t},t.valueFormat=function(a){if(!arguments.length)return m;m=a;return t},t.rectClass=function(a){if(!arguments.length)return q;q=a;return t};return t},a.models.discreteBarChart=function(){function q(a){a.each(function(h){var k=d3.select(this),r=this,s=(f||parseInt(k.style("width"))||960)-e.left-e.right,t=(g||parseInt(k.style("height"))||400)-e.top-e.bottom;q.update=function(){o.beforeUpdate(),a.transition().call(q)},q.container=this;if(!h||!h.length||!h.filter(function(a){return a.values.length}).length){var u=k.selectAll(".nv-noData").data([n]);u.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),u.attr("x",e.left+s/2).attr("y",e.top+t/2).text(function(a){return a});return q}k.selectAll(".nv-noData").remove(),l=b.xScale(),m=b.yScale();var v=k.selectAll("g.nv-wrap.nv-discreteBarWithAxes").data([h]),w=v.enter().append("g").attr("class","nvd3 nv-wrap nv-discreteBarWithAxes").append("g"),z=w.append("defs"),A=v.select("g");w.append("g").attr("class","nv-x nv-axis"),w.append("g").attr("class","nv-y nv-axis"),w.append("g").attr("class","nv-barsWrap"),A.attr("transform","translate("+e.left+","+e.top+")"),b.width(s).height(t);var B=A.select(".nv-barsWrap").datum(h.filter(function(a){return!a.disabled}));d3.transition(B).call(b),z.append("clipPath").attr("id","nv-x-label-clip-"+b.id()).append("rect"),A.select("#nv-x-label-clip-"+b.id()+" rect").attr("width",l.rangeBand()*(i?2:1)).attr("height",16).attr("x",-l.rangeBand()/(i?1:2)),c.scale(l).ticks(s/100).tickSize(-t,0),A.select(".nv-x.nv-axis").attr("transform","translate(0,"+(m.range()[0]+(b.showValues()&&m.domain()[0]<0?16:0))+")"),A.select(".nv-x.nv-axis").transition().duration(0).call(c);var C=A.select(".nv-x.nv-axis").selectAll("g");i&&C.selectAll("text").attr("transform",function(a,b,c){return"translate(0,"+(c%2==0?"5":"17")+")"}),d.scale(m).ticks(t/36).tickSize(-s,0),d3.transition(A.select(".nv-y.nv-axis")).call(d),o.on("tooltipShow",function(a){j&&p(a,r.parentNode)})});return q}var b=a.models.discreteBar(),c=a.models.axis(),d=a.models.axis(),e={top:15,right:10,bottom:50,left:60},f=null,g=null,h=a.utils.getColor(),i=!1,j=!0,k=function(a,b,c,d,e){return"

"+b+"

"+"

"+c+"

"},l,m,n="No Data Available.",o=d3.dispatch("tooltipShow","tooltipHide","beforeUpdate");c.orient("bottom").highlightZero(!1).showMaxMin(!1).tickFormat(function(a){return a}),d.orient("left").tickFormat(d3.format(",.1f"));var p=function(e,f){var g=e.pos[0]+(f.offsetLeft||0),h=e.pos[1]+(f.offsetTop||0),i=c.tickFormat()(b.x()(e.point,e.pointIndex)),j=d.tickFormat()(b.y()(e.point,e.pointIndex)),l=k(e.series.key,i,j,e,q);a.tooltip.show([g,h],l,e.value<0?"n":"s",null,f)};b.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+e.left,a.pos[1]+e.top],o.tooltipShow(a)}),b.dispatch.on("elementMouseout.tooltip",function(a){o.tooltipHide(a)}),o.on("tooltipHide",function(){j&&a.tooltip.cleanup()}),q.dispatch=o,q.discretebar=b,q.xAxis=c,q.yAxis=d,d3.rebind(q,b,"x","y","xDomain","yDomain","forceX","forceY","id","showValues","valueFormat"),q.margin=function(a){if(!arguments.length)return e;e.top=typeof a.top!="undefined"?a.top:e.top,e.right=typeof a.right!="undefined"?a.right:e.right,e.bottom=typeof a.bottom!="undefined"?a.bottom:e.bottom,e.left=typeof a.left!="undefined"?a.left:e.left;return q},q.width=function(a){if(!arguments.length)return f;f=a;return q},q.height=function(a){if(!arguments.length)return g;g=a;return q},q.color=function(c){if(!arguments.length)return h;h=a.utils.getColor(c),b.color(h);return q},q.staggerLabels=function(a){if(!arguments.length)return i;i=a;return q},q.tooltips=function(a){if(!arguments.length)return j;j=a;return q},q.tooltipContent=function(a){if(!arguments.length)return k;k=a;return q},q.noData=function(a){if(!arguments.length)return n;n=a;return q};return q},a.models.distribution=function(){function k(a){a.each(function(a){var i=c-(e==="x"?b.left+b.right:b.top+b.bottom),k=e=="x"?"y":"x",l=d3.select(this);j=j||h;var m=l.selectAll("g.nv-distribution").data([a]),n=m.enter().append("g").attr("class","nvd3 nv-distribution"),o=n.append("g"),p=m.select("g");m.attr("transform","translate("+b.left+","+b.top+")");var q=p.selectAll("g.nv-dist").data(function(a){return a},function(a){return a.key});q.enter().append("g"),q.attr("class",function(a,b){return"nv-dist nv-series-"+b}).style("stroke",function(a,b){return g(a,b)});var r=q.selectAll("line.nv-dist"+e).data(function(a){return a.values});r.enter().append("line").attr(e+"1",function(a,b){return j(f(a,b))}).attr(e+"2",function(a,b){return j(f(a,b))}),d3.transition(q.exit().selectAll("line.nv-dist"+e)).attr(e+"1",function(a,b){return h(f(a,b))}).attr(e+"2",function(a,b){return h(f(a,b))}).style("stroke-opacity",0).remove(),r.attr("class",function(a,b){return"nv-dist"+e+" nv-dist"+e+"-"+b}).attr(k+"1",0).attr(k+"2",d),d3.transition(r).attr(e+"1",function(a,b){return h(f(a,b))}).attr(e+"2",function(a,b){return h(f(a,b))}),j=h.copy()});return k}var b={top:0,right:0,bottom:0,left:0},c=400,d=8,e="x",f=function(a){return a[e]},g=a.utils.defaultColor(),h=d3.scale.linear(),i,j;k.margin=function(a){if(!arguments.length)return b;b.top=typeof a.top!="undefined"?a.top:b.top,b.right=typeof a.right!="undefined"?a.right:b.right,b.bottom=typeof a.bottom!="undefined"?a.bottom:b.bottom,b.left=typeof a.left!="undefined"?a.left:b.left;return k},k.width=function(a){if(!arguments.length)return c;c=a;return k},k.axis=function(a){if(!arguments.length)return e;e=a;return k},k.size=function(a){if(!arguments.length)return d;d=a;return k},k.getData=function(a){if(!arguments.length)return f;f=d3.functor(a);return k},k.scale=function(a){if(!arguments.length)return h;h=a;return k},k.color=function(b){if(!arguments.length)return g;g=a.utils.getColor(b);return k};return k},a.models.indentedTree=function(){function o(a){a.each(function(b){function C(a){var b=a.values||a._values;return b&&b.length}function B(a){return a._values&&a._values.length}function A(a){return a._values&&a._values.length?l:a.values&&a.values.length?m:""}function z(a,b,c){d3.event.stopPropagation();if(d3.event.shiftKey&&!c){d3.event.shiftKey=!1,a.values&&a.values.forEach(function(a){(a.values||a._values)&&z(a,0,!0)});return!0}if(!C(a))return!0;a.values?(a._values=a.values,a.values=null):(a.values=a._values,a._values=null),o.update()}var c=0,e=1,f=d3.layout.tree().children(function(a){return a.values}).size([d,i]);o.update=function(){a.transition().call(o)},o.container=this,b[0]||(b[0]={key:h});var p=f.nodes(b[0]),q=d3.select(this).selectAll("div").data([[p]]),r=q.enter().append("div").attr("class","nvd3 nv-wrap nv-indentedtree"),s=r.append("table"),t=q.select("table").attr("width","100%").attr("class",k);if(g){var u=s.append("thead"),v=u.append("tr");j.forEach(function(a){v.append("th").attr("width",a.width?a.width:"10%").style("text-align",a.type=="numeric"?"right":"left").append("span").text(a.label)})}var w=t.selectAll("tbody").data(function(a){return a});w.enter().append("tbody"),e=d3.max(p,function(a){return a.depth}),f.size([d,e*i]);var x=w.selectAll("tr").data(function(a){return a},function(a){return a.id||a.id==++c});x.exit().remove(),x.select("img.nv-treeicon").attr("src",A).classed("folded",B);var y=x.enter().append("tr");j.forEach(function(a,b){var c=y.append("td").style("padding-left",function(a){return(b?0:a.depth*i+12+(A(a)?0:16))+"px"},"important").style("text-align",a.type=="numeric"?"right":"left");b==0&&c.append("img").classed("nv-treeicon",!0).classed("nv-folded",B).attr("src",A).style("width","14px").style("height","14px").style("padding","0 1px").style("display",function(a){return A(a)?"inline-block":"none"}).on("click",z),c.append("span").attr("class",d3.functor(a.classes)).text(function(b){return a.format?a.format(b):b[a.key]||"-"}),a.showCount&&c.append("span").attr("class","nv-childrenCount").text(function(a){return a.values&&a.values.length||a._values&&a._values.length?"("+(a.values&&a.values.length||a._values&&a._values.length)+")":""}),a.click&&c.select("span").on("click",a.click)}),x.order().on("click",function(a){n.elementClick({row:this,data:a,pos:[a.x,a.y]})}).on("dblclick",function(a){n.elementDblclick({row:this,data:a,pos:[a.x,a.y]})}).on("mouseover",function(a){n.elementMouseover({row:this,data:a,pos:[a.x,a.y]})}).on("mouseout",function(a){n.elementMouseout({row:this,data:a,pos:[a.x,a.y]})})});return o}var b={top:0,right:0,bottom:0,left:0},c=960,d=500,e=a.utils.defaultColor(),f=Math.floor(Math.random()*1e4),g=!0,h="No Data Available.",i=20,j=[{key:"key",label:"Name",type:"text"}],k=null,l="images/grey-plus.png",m="images/grey-minus.png",n=d3.dispatch("elementClick","elementDblclick","elementMouseover","elementMouseout");o.margin=function(a){if(!arguments.length)return b;b.top=typeof a.top!="undefined"?a.top:b.top,b.right=typeof a.right!="undefined"?a.right:b.right,b.bottom=typeof a.bottom!="undefined"?a.bottom:b.bottom,b.left=typeof a.left!="undefined"?a.left:b.left;return o},o.width=function(a){if(!arguments.length)return c;c=a;return o},o.height=function(a){if(!arguments.length)return d;d=a;return o},o.color=function(b){if(!arguments.length)return e;e=a.utils.getColor(b),scatter.color(e);return o},o.id=function(a){if(!arguments.length)return f;f=a;return o},o.header=function(a){if(!arguments.length)return g;g=a;return o},o.noData=function(a){if(!arguments.length)return h;h=a;return o},o.columns=function(a){if(!arguments.length)return j;j=a;return o},o.tableClass=function(a){if(!arguments.length)return k;k=a;return o},o.iconOpen=function(a){if(!arguments.length)return l;l=a;return o},o.iconClose=function(a){if(!arguments.length)return m;m=a;return o};return o},a.models.legend=function(){function i(a){a.each(function(a){var i=c-b.left-b.right,j=d3.select(this),l=j.selectAll("g.nv-legend").data([a]),m=l.enter().append("g").attr("class","nvd3 nv-legend").append("g"),n=l.select("g");l.attr("transform","translate("+b.left+","+b.top+")");var o=n.selectAll(".nv-series").data(function(a){return a}),p=o.enter().append("g").attr("class","nv-series").on("mouseover",function(a,b){h.legendMouseover(a,b)}).on("mouseout",function(a,b){h.legendMouseout(a,b)}).on("click",function(a,b){h.legendClick(a,b)}).on("dblclick",function(a,b){h.legendDblclick(a,b)});p.append("circle").style("stroke-width",2).attr("r",5),p.append("text").attr("text-anchor","start").attr("dy",".32em").attr("dx","8"),o.classed("disabled",function(a){return a.disabled}),o.exit().remove(),o.select("circle").style("fill",function(a,b){return a.color||f(a,b)}).style("stroke",function(a,b){return a.color||f(a,b)}),o.select("text").text(e);if(g){var q=[];o.each(function(a,b){q.push(d3.select(this).select("text").node().getComputedTextLength()+28)});var r=0,s=0,t=[];while(si&&r>1){t=[],r--;for(k=0;k(t[k%r]||0)&&(t[k%r]=q[k]);s=t.reduce(function(a,b,c,d){return a+b})}var u=[];for(var v=0,w=0;vz&&(z=y);return"translate("+A+","+x+")"}),n.attr("transform","translate("+(c-b.right-z)+","+b.top+")"),d=b.top+b.bottom+x+15}});return i}var b={top:5,right:0,bottom:5,left:0},c=400,d=20,e=function(a){return a.key},f=a.utils.defaultColor(),g=!0,h=d3.dispatch("legendClick","legendDblclick","legendMouseover","legendMouseout");i.dispatch=h,i.margin=function(a){if(!arguments.length)return b;b.top=typeof a.top!="undefined"?a.top:b.top,b.right=typeof a.right!="undefined"?a.right:b.right,b.bottom=typeof a.bottom!="undefined"?a.bottom:b.bottom,b.left=typeof a.left!="undefined"?a.left:b.left;return i},i.width=function(a){if(!arguments.length)return c;c=a;return i},i.height=function(a){if(!arguments.length)return d;d=a;return i},i.key=function(a){if(!arguments.length)return e;e=a;return i},i.color=function(b){if(!arguments.length)return f;f=a.utils.getColor(b);return i},i.align=function(a){if(!arguments.length)return g;g=a;return i};return i},a.models.line=function(){function q(a){a.each(function(a){var q=d-c.left-c.right,r=e-c.top-c.bottom,s=d3.select(this);l=b.xScale(),m=b.yScale(),o=o||l,p=p||m;var t=s.selectAll("g.nv-wrap.nv-line").data([a]),u=t.enter().append("g").attr("class","nvd3 nv-wrap nv-line"),v=u.append("defs"),w=u.append("g"),z=t.select("g");w.append("g").attr("class","nv-groups"),w.append("g").attr("class","nv-scatterWrap"),t.attr("transform","translate("+c.left+","+c.top+")"),b.width(q).height(r);var A=t.select(".nv-scatterWrap");d3.transition(A).call(b),v.append("clipPath").attr("id","nv-edge-clip-"+b.id()).append("rect"),t.select("#nv-edge-clip-"+b.id()+" rect").attr("width",q).attr("height",r),z.attr("clip-path",k?"url(#nv-edge-clip-"+b.id()+")":""),A.attr("clip-path",k?"url(#nv-edge-clip-"+b.id()+")":"");var B=t.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a){return a.key});B.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),d3.transition(B.exit()).style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),B.attr("class",function(a,b){return"nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}).style("fill",function(a,b){return f(a,b)}).style("stroke",function(a,b){return f(a,b)}),d3.transition(B).style("stroke-opacity",1).style("fill-opacity",.5);var C=B.selectAll("path.nv-area").data(function(a){return j(a)?[a]:[]});C.enter().append("path").attr("class","nv-area").attr("d",function(a){return d3.svg.area().interpolate(n).defined(i).x(function(a,b){return o(g(a,b))}).y0(function(a,b){return p(h(a,b))}).y1(function(a,b){return p(m.domain()[0]<=0?m.domain()[1]>=0?0:m.domain()[1]:m.domain()[0])}).apply(this,[a.values])}),d3.transition(B.exit().selectAll("path.nv-area")).attr("d",function(a){return d3.svg.area().interpolate(n).defined(i).x(function(a,b){return o(g(a,b))}).y0(function(a,b){return p(h(a,b))}).y1(function(a,b){return p(m.domain()[0]<=0?m.domain()[1]>=0?0:m.domain()[1]:m.domain()[0])}).apply(this,[a.values])}),d3.transition(C).attr("d",function(a){return d3.svg.area().interpolate(n).defined(i).x(function(a,b){return o(g(a,b))}).y0(function(a,b){return p(h(a,b))}).y1(function(a,b){return p(m.domain()[0]<=0?m.domain()[1]>=0?0:m.domain()[1]:m.domain()[0])}).apply(this,[a.values])});var D=B.selectAll("path.nv-line").data(function(a){return[a.values]});D.enter().append("path").attr("class","nv-line").attr("d",d3.svg.line().interpolate(n).defined(i).x(function(a,b){return o(g(a,b))}).y(function(a,b){return p(h(a,b))})),d3.transition(B.exit().selectAll("path.nv-line")).attr("d",d3.svg.line().interpolate(n).defined(i).x(function(a,b){return l(g(a,b))}).y(function(a,b){return m(h(a,b))})),d3.transition(D).attr("d",d3.svg.line().interpolate(n).defined(i).x(function(a,b){return l(g(a,b))}).y(function(a,b){return m(h(a,b))})),o=l.copy(),p=m.copy()});return q}var b=a.models.scatter(),c={top:0,right:0,bottom:0,left:0},d=960,e=500,f=a.utils.defaultColor(),g=function(a){return a.x},h=function(a){return a.y},i=function(a,b){return!isNaN(h(a,b))&&h(a,b)!==null},j=function(a){return a.area},k=!1,l,m,n="linear";b.size(16).sizeDomain([16,256]);var o,p;q.dispatch=b.dispatch,q.scatter=b,d3.rebind(q,b,"id","interactive","size","xScale","yScale","zScale","xDomain","yDomain","sizeDomain","forceX","forceY","forceSize","clipVoronoi","clipRadius","padData"),q.margin=function(a){if(!arguments.length)return c;c.top=typeof a.top!="undefined"?a.top:c.top,c.right=typeof a.right!="undefined"?a.right:c.right,c.bottom=typeof a.bottom!="undefined"?a.bottom:c.bottom,c.left=typeof a.left!="undefined"?a.left:c.left;return q},q.width=function(a){if(!arguments.length)return d;d=a;return q},q.height=function(a){if(!arguments.length)return e;e=a;return q},q.x=function(a){if(!arguments.length)return g;g=a,b.x(a);return q},q.y=function(a){if(!arguments.length)return h;h=a,b.y(a);return q},q.clipEdge=function(a){if(!arguments.length)return k;k=a;return q},q.color=function(c){if(!arguments.length)return f;f=a.utils.getColor(c),b.color(f);return q},q.interpolate=function(a){if(!arguments.length)return n;n=a;return q},q.defined=function(a){if(!arguments.length)return i;i=a;return q},q.isArea=function(a){if(!arguments.length)return j;j=d3.functor(a);return q};return q},a.models.lineChart=function(){function s(a){a.each(function(l){var t=d3.select(this),u=this,v=(h||parseInt(t.style("width"))||960)-f.left-f.right,w=(i||parseInt(t.style("height"))||400)-f.top-f.bottom;s.update=function(){s(a)},s.container=this;if(!l||!l.length||!l.filter(function(a){return a.values.length}).length){var z=t.selectAll(".nv-noData").data([p]);z.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),z.attr("x",f.left+v/2).attr("y",f.top+w/2).text(function(a){return a});return s}t.selectAll(".nv-noData").remove(),m=b.xScale(),n=b.yScale();var A=t.selectAll("g.nv-wrap.nv-lineChart").data([l]),B=A.enter().append("g").attr("class","nvd3 nv-wrap nv-lineChart").append("g"),C=A.select("g");B.append("g").attr("class","nv-x nv-axis"),B.append("g").attr("class","nv-y nv-axis"),B.append("g").attr("class","nv-linesWrap"),B.append("g").attr("class","nv-legendWrap"),j&&(e.width(v),C.select(".nv-legendWrap").datum(l).call(e),f.top!=e.height()&&(f.top=e.height(),w=(i||parseInt(t.style("height"))||400)-f.top-f.bottom),A.select(".nv-legendWrap").attr("transform","translate(0,"+ -f.top+")")),A.attr("transform","translate("+f.left+","+f.top+")"),b.width(v).height(w).color(l.map(function(a,b){return a.color||g(a,b)}).filter(function(a,b){return!l[b].disabled}));var D=C.select(".nv-linesWrap").datum(l.filter(function(a){return!a.disabled}));d3.transition(D).call(b),c.scale(m).ticks(v/100).tickSize(-w,0),C.select(".nv-x.nv-axis").attr("transform","translate(0,"+n.range()[0]+")"),d3.transition(C.select(".nv-x.nv-axis")).call(c),d.scale(n).ticks(w/36).tickSize(-v,0),d3.transition(C.select(".nv-y.nv-axis")).call(d),e.dispatch.on("legendClick",function(b,c){b.disabled=!b.disabled,l.filter(function(a){return!a.disabled}).length||l.map(function(a){a.disabled=!1,A.selectAll(".nv-series").classed("disabled",!1);return a}),o.disabled=l.map(function(a){return!!a.disabled}),q.stateChange(o),a.transition().call(s)}),q.on("tooltipShow",function(a){k&&r(a,u.parentNode)}),q.on("changeState",function(b){typeof b.disabled!="undefined"&&(l.forEach(function(a,c){a.disabled=b.disabled[c]}),o.disabled=b.disabled),a.call(s)})});return s}var b=a.models.line(),c=a.models.axis(),d=a.models.axis(),e=a.models.legend(),f={top:30,right:20,bottom:50,left:60},g=a.utils.defaultColor(),h=null,i=null,j=!0,k=!0,l=function(a,b,c,d,e){return"

"+a+"

"+"

"+c+" at "+b+"

"},m,n,o={},p="No Data Available.",q=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState");c.orient("bottom").tickPadding(7),d.orient("left");var r=function(e,f){if(f){var g=d3.select(f).select("svg"),h=g.attr("viewBox");if(h){h=h.split(" ");var i=parseInt(g.style("width"))/h[2];e.pos[0]=e.pos[0]*i,e.pos[1]=e.pos[1]*i}}var j=e.pos[0]+(f.offsetLeft||0),k=e.pos[1]+(f.offsetTop||0),m=c.tickFormat()(b.x()(e.point,e.pointIndex)),n=d.tickFormat()(b.y()(e.point,e.pointIndex)),o=l(e.series.key,m,n,e,s);a.tooltip.show([j,k],o,null,null,f)};b.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+f.left,a.pos[1]+f.top],q.tooltipShow(a)}),b.dispatch.on("elementMouseout.tooltip",function(a){q.tooltipHide(a)}),q.on("tooltipHide",function(){k&&a.tooltip.cleanup()}),s.dispatch=q,s.lines=b,s.legend=e,s.xAxis=c,s.yAxis=d,d3.rebind(s,b,"defined","isArea","x","y","size","xScale","yScale","xDomain","yDomain","forceX","forceY","interactive","clipEdge","clipVoronoi","id","interpolate"),s.margin=function(a){if(!arguments.length)return f;f.top=typeof a.top!="undefined"?a.top:f.top,f.right=typeof a.right!="undefined"?a.right:f.right,f.bottom=typeof a.bottom!="undefined"?a.bottom:f.bottom,f.left=typeof a.left!="undefined"?a.left:f.left;return s},s.width=function(a){if(!arguments.length)return h;h=a;return s},s.height=function(a){if(!arguments.length)return i;i=a;return s},s.color=function(b){if(!arguments.length)return g;g=a.utils.getColor(b),e.color(g);return s},s.showLegend=function(a){if(!arguments.length)return j;j=a;return s},s.tooltips=function(a){if(!arguments.length)return k;k=a;return s},s.tooltipContent=function(a){if(!arguments.length)return l;l=a;return s},s.state=function(a){if(!arguments.length)return o;o=a;return s},s.noData=function(a){if(!arguments.length)return p;p=a;return s};return s},a.models.linePlusBarChart=function(){function x(a){a.each(function(k){var l=d3.select(this),p=this,y=(i||parseInt(l.style("width"))||960)-h.left-h.right,z=(j||parseInt(l.style("height"))||400)-h.top-h.bottom;x.update=function(){x(a)},x.container=this;if(!k||!k.length||!k.filter(function(a){return a.values.length}).length){var A=l.selectAll(".nv-noData").data([t]);A.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),A.attr("x",h.left+y/2).attr("y",h.top+z/2).text(function(a){return a});return x}l.selectAll(".nv-noData").remove();var B=k.filter(function(a){return!a.disabled&&a.bar}),C=k.filter(function(a){return!a.bar});q=C.filter(function(a){return!a.disabled}).length&&C.filter(function(a){return!a.disabled})[0].values.length?b.xScale():c.xScale(),r=c.yScale(),s=b.yScale();var D=d3.select(this).selectAll("g.nv-wrap.nv-linePlusBar").data([k]),E=D.enter().append("g").attr("class","nvd3 nv-wrap nv-linePlusBar").append("g"),F=D.select("g");E.append("g").attr("class","nv-x nv-axis"),E.append("g").attr("class","nv-y1 nv-axis"),E.append("g").attr("class","nv-y2 nv-axis"),E.append("g").attr("class","nv-barsWrap"),E.append("g").attr("class","nv-linesWrap"),E.append("g").attr("class","nv-legendWrap"),n&&(g.width(y/2),F.select(".nv-legendWrap").datum(k.map(function(a){a.originalKey=a.originalKey===undefined?a.key:a.originalKey,a.key=a.originalKey+(a.bar?" (left axis)":" (right axis)");return a})).call(g),h.top!=g.height()&&(h.top=g.height(),z=(j||parseInt(l.style("height"))||400)-h.top-h.bottom),F.select(".nv-legendWrap").attr("transform","translate("+y/2+","+ -h.top+")")),D.attr("transform","translate("+h.left+","+h.top+")"),b.width(y).height(z).color(k.map(function(a,b){return a.color||m(a,b)}).filter(function(a,b){return!k[b].disabled&&!k[b].bar})),c.width(y).height(z).color(k.map(function(a,b){return a.color||m(a,b)}).filter(function(a,b){return!k[b].disabled&&k[b].bar}));var G=F.select(".nv-barsWrap").datum(B.length?B:[{values:[]}]),H=F.select(".nv-linesWrap").datum(C[0].disabled?[{values:[]}]:C);d3.transition(G).call(c),d3.transition(H).call(b),d.scale(q).ticks(y/100).tickSize(-z,0),F.select(".nv-x.nv-axis").attr("transform","translate(0,"+r.range()[0]+")"),d3.transition(F.select(".nv-x.nv-axis")).call(d),e.scale(r).ticks(z/36).tickSize(-y,0),d3.transition(F.select(".nv-y1.nv-axis")).style("opacity",B.length?1:0).call(e),f.scale(s).ticks(z/36).tickSize(B.length?0:-y,0),F.select(".nv-y2.nv-axis").style("opacity",C.length?1:0).attr("transform","translate("+y+",0)"),d3.transition(F.select(".nv-y2.nv-axis")).call(f),g.dispatch.on("legendClick",function(b,c){b.disabled=!b.disabled,k.filter(function(a){return!a.disabled}).length||k.map(function(a){a.disabled=!1,D.selectAll(".nv-series").classed("disabled",!1);return a}),v.disabled=k.map(function(a){return!!a.disabled}),u.stateChange(v),a.transition().call(x)}),u.on("tooltipShow",function(a){o&&w(a,p.parentNode)}),u.on("changeState",function(b){typeof b.disabled!="undefined"&&(k.forEach(function(a,c){a.disabled=b.disabled[c]}),v.disabled=b.disabled),a.call(x)})});return x}var b=a.models.line(),c=a.models.historicalBar(),d=a.models.axis(),e=a.models.axis(),f=a.models.axis(),g=a.models.legend(),h={top:30,right:60,bottom:50,left:60},i=null,j=null,k=function(a){return a.x},l=function(a){return a.y},m=a.utils.defaultColor(),n=!0,o=!0,p=function(a,b,c,d,e){return"

"+a+"

"+"

"+c+" at "+b+"

"},q,r,s,t="No Data Available.",u=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState");c.padData(!0),b.clipEdge(!1).padData(!0),d.orient("bottom").tickPadding(7).highlightZero(!1),e.orient("left"),f.orient("right");var v={},w=function(c,g){var h=c.pos[0]+(g.offsetLeft||0),i=c.pos[1]+(g.offsetTop||0),j=d.tickFormat()(b.x()(c.point,c.pointIndex)),k=(c.series.bar?e:f).tickFormat()(b.y()(c.point,c.pointIndex)),l=p(c.series.key,j,k,c,x);a.tooltip.show([h,i],l,c.value<0?"n":"s",null,g)};b.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+h.left,a.pos[1]+h.top],u.tooltipShow(a)}),b.dispatch.on("elementMouseout.tooltip",function(a){u.tooltipHide(a)}),c.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+h.left,a.pos[1]+h.top],u.tooltipShow(a)}),c.dispatch.on("elementMouseout.tooltip",function(a){u.tooltipHide(a)}),u.on("tooltipHide",function(){o&&a.tooltip.cleanup()}),x.dispatch=u,x.legend=g,x.lines=b,x.bars=c,x.xAxis=d,x.y1Axis=e,x.y2Axis=f,d3.rebind(x,b,"defined","size","clipVoronoi","interpolate"),x.x=function(a){if(!arguments.length)return k;k=a,b.x(a),c.x(a);return x},x.y=function(a){if(!arguments.length)return l;l=a,b.y(a),c.y(a);return x},x.margin=function(a){if(!arguments.length)return h;h.top=typeof a.top!="undefined"?a.top:h.top,h.right=typeof a.right!="undefined"?a.right:h.right,h.bottom=typeof a.bottom!="undefined"?a.bottom:h.bottom,h.left=typeof a.left!="undefined"?a.left:h.left;return x},x.width=function(a){if(!arguments.length)return i;i=a;return x},x.height=function(a){if(!arguments.length)return j;j=a;return x},x.color=function(b){if(!arguments.length)return m;m=a.utils.getColor(b),g.color(m);return x},x.showLegend=function(a){if(!arguments.length)return n;n=a;return x},x.tooltips=function(a){if(!arguments.length)return o;o=a;return x},x.tooltipContent=function(a){if(!arguments.length)return p;p=a;return x},x.state=function(a){if(!arguments.length)return v;v=a;return x},x.noData=function(a){if(!arguments.length)return t;t=a;return x};return x},a.models.lineWithFocusChart=function(){function A(a){a.each(function(w){function R(){u=i.empty()?null:i.extent(),extent=i.empty()?r.domain():i.extent(),y.brush({extent:extent,brush:i}),Q();var a=J.select(".nv-focus .nv-linesWrap").datum(w.filter(function(a){return!a.disabled}).map(function(a,c){return{key:a.key,values:a.values.filter(function(a,c){return b.x()(a,c)>=extent[0]&&b.x()(a,c)<=extent[1]})}}));d3.transition(a).call(b),d3.transition(J.select(".nv-focus .nv-x.nv-axis")).call(d),d3.transition(J.select(".nv-focus .nv-y.nv-axis")).call(e)}function Q(){i.empty()||i.extent(u),N.data([i.empty()?r.domain():u]).each(function(a,b){var c=r(a[0])-p.range()[0],d=p.range()[1]-r(a[1]);d3.select(this).select(".left").attr("width",c<0?0:c),d3.select(this).select(".right").attr("x",r(a[1])).attr("width",d<0?0:d)})}function P(a){var b=+(a=="e"),c=b?1:-1,d=F/3;return"M"+.5*c+","+d+"A6,6 0 0 "+b+" "+6.5*c+","+(d+6)+"V"+(2*d-6)+"A6,6 0 0 "+b+" "+.5*c+","+2*d+"Z"+"M"+2.5*c+","+(d+8)+"V"+(2*d-8)+"M"+4.5*c+","+(d+8)+"V"+(2*d-8)}var B=d3.select(this),C=this,D=(m||parseInt(B.style("width"))||960)-j.left-j.right,E=(n||parseInt(B.style("height"))||400)-j.top-j.bottom-o,F=o-k.top-k.bottom;A.update=function(){A(a)},A.container=this;if(!w||!w.length||!w.filter(function(a){return a.values.length}).length){var G=B.selectAll(".nv-noData").data([x]);G.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),G.attr("x",j.left+D/2).attr("y",j.top+E/2).text(function(a){return a});return A}B.selectAll(".nv-noData").remove(),p=b.xScale(),q=b.yScale(),r=c.xScale(),s=c.yScale();var H=B.selectAll("g.nv-wrap.nv-lineWithFocusChart").data([w]),I=H.enter().append("g").attr("class","nvd3 nv-wrap nv-lineWithFocusChart").append("g"),J=H.select("g");I.append("g").attr("class","nv-legendWrap");var K=I.append("g").attr("class","nv-focus");K.append("g").attr("class","nv-x nv-axis"),K.append("g").attr("class","nv-y nv-axis"),K.append("g").attr("class","nv-linesWrap");var L=I.append("g").attr("class","nv-context");L.append("g").attr("class","nv-x nv-axis"),L.append("g").attr("class","nv-y nv-axis"),L.append("g").attr("class","nv-linesWrap"),L.append("g").attr("class","nv-brushBackground"),L.append("g").attr("class","nv-x nv-brush"),t&&(h.width(D),J.select(".nv-legendWrap").datum(w).call(h),j.top!=h.height()&&(j.top=h.height(),E=(n||parseInt(B.style("height"))||400)-j.top-j.bottom-o),J.select(".nv-legendWrap").attr("transform","translate(0,"+ -j.top+")")),H.attr("transform","translate("+j.left+","+j.top+")"),b.width(D).height(E).color(w.map(function(a,b){return a.color||l(a,b)}).filter(function(a,b){return!w[b].disabled})),c.defined(b.defined()).width(D).height(F).color(w.map(function(a,b){return a.color||l(a,b)}).filter(function(a,b){return!w[b].disabled})),J.select(".nv-context").attr("transform","translate(0,"+(E+j.bottom+k.top)+")");var M=J.select(".nv-context .nv-linesWrap").datum(w.filter(function(a){return!a.disabled}));d3.transition(M).call(c),d.scale(p).ticks(D/100).tickSize(-E,0),e.scale(q).ticks(E/36).tickSize(-D,0),J.select(".nv-focus .nv-x.nv-axis").attr("transform","translate(0,"+E+")"),i.x(r).on("brush",R),u&&i.extent(u);var N=J.select(".nv-brushBackground").selectAll("g").data([u||i.extent()]),O=N.enter().append("g");O.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",F),O.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",F),gBrush=J.select(".nv-x.nv-brush").call(i),gBrush.selectAll("rect").attr("height",F),gBrush.selectAll(".resize").append("path").attr("d",P),R(),f.scale(r).ticks(D/100).tickSize(-F,0),J.select(".nv-context .nv-x.nv-axis").attr("transform","translate(0,"+s.range()[0]+")"),d3.transition(J.select(".nv-context .nv-x.nv-axis")).call(f),g.scale(s).ticks(F/36).tickSize(-D,0),d3.transition(J.select(".nv-context .nv-y.nv-axis")).call(g),J.select(".nv-context .nv-x.nv-axis").attr("transform","translate(0,"+s.range()[0]+")"),h.dispatch.on("legendClick",function(b,c){b.disabled=!b.disabled,w.filter(function(a){return!a.disabled}).length||w.map(function(a){a.disabled=!1,H.selectAll(".nv-series").classed("disabled",!1);return a}),a.transition().call(A)}),y.on("tooltipShow",function(a){v&&z(a,C.parentNode)})});return A}var b=a.models.line(),c=a.models.line(),d=a.models.axis(),e=a.models.axis(),f=a.models.axis(),g=a.models.axis(),h=a.models.legend(),i=d3.svg.brush(),j={top:30,right:30,bottom:30,left:60},k={top:0,right:30,bottom:20,left:60},l=a.utils.defaultColor(),m=null,n=null,o=100,p,q,r,s,t=!0,u=null,v=!0,w=function(a,b,c,d,e){return"

"+a+"

"+"

"+c+" at "+b+"

"},x="No Data Available.",y=d3.dispatch("tooltipShow","tooltipHide","brush");b.clipEdge(!0),c.interactive(!1),d.orient("bottom").tickPadding(5),e.orient("left"),f.orient("bottom").tickPadding(5),g.orient("left");var z=function(c,f){var g=c.pos[0]+(f.offsetLeft||0),h=c.pos[1]+(f.offsetTop||0),i=d.tickFormat()(b.x()(c.point,c.pointIndex)),j=e.tickFormat()(b.y()(c.point,c.pointIndex)),k=w(c.series.key,i,j -,c,A);a.tooltip.show([g,h],k,null,null,f)};b.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+j.left,a.pos[1]+j.top],y.tooltipShow(a)}),b.dispatch.on("elementMouseout.tooltip",function(a){y.tooltipHide(a)}),y.on("tooltipHide",function(){v&&a.tooltip.cleanup()}),A.dispatch=y,A.legend=h,A.lines=b,A.lines2=c,A.xAxis=d,A.yAxis=e,A.x2Axis=f,A.y2Axis=g,d3.rebind(A,b,"defined","isArea","size","xDomain","yDomain","forceX","forceY","interactive","clipEdge","clipVoronoi","id"),A.x=function(a){if(!arguments.length)return b.x;b.x(a),c.x(a);return A},A.y=function(a){if(!arguments.length)return b.y;b.y(a),c.y(a);return A},A.margin=function(a){if(!arguments.length)return j;j.top=typeof a.top!="undefined"?a.top:j.top,j.right=typeof a.right!="undefined"?a.right:j.right,j.bottom=typeof a.bottom!="undefined"?a.bottom:j.bottom,j.left=typeof a.left!="undefined"?a.left:j.left;return A},A.margin2=function(a){if(!arguments.length)return k;k=a;return A},A.width=function(a){if(!arguments.length)return m;m=a;return A},A.height=function(a){if(!arguments.length)return n;n=a;return A},A.height2=function(a){if(!arguments.length)return o;o=a;return A},A.color=function(b){if(!arguments.length)return l;l=a.utils.getColor(b),h.color(l);return A},A.showLegend=function(a){if(!arguments.length)return t;t=a;return A},A.tooltips=function(a){if(!arguments.length)return v;v=a;return A},A.tooltipContent=function(a){if(!arguments.length)return w;w=a;return A},A.interpolate=function(a){if(!arguments.length)return b.interpolate();b.interpolate(a),c.interpolate(a);return A},A.noData=function(a){if(!arguments.length)return x;x=a;return A},A.xTickFormat=function(a){if(!arguments.length)return d.tickFormat();d.tickFormat(a),f.tickFormat(a);return A},A.yTickFormat=function(a){if(!arguments.length)return e.tickFormat();e.tickFormat(a),g.tickFormat(a);return A};return A},a.models.multiBar=function(){function t(a){a.each(function(a){var t=c-b.left-b.right,u=d-b.top-b.bottom,v=d3.select(this);l&&(a=d3.layout.stack().offset("zero").values(function(a){return a.values}).y(i)(a)),a=a.map(function(a,b){a.values=a.values.map(function(a){a.series=b;return a});return a}),l&&a[0].values.map(function(b,c){var d=0,e=0;a.map(function(a){var b=a.values[c];b.size=Math.abs(b.y),b.y<0?(b.y1=e,e=e-b.size):(b.y1=b.size+d,d=d+b.size)})});var w=o&&p?[]:a.map(function(a){return a.values.map(function(a,b){return{x:h(a,b),y:i(a,b),y0:a.y0,y1:a.y1}})});e.domain(d3.merge(w).map(function(a){return a.x})).rangeBands([0,t],.1),f.domain(p||d3.extent(d3.merge(w).map(function(a){return a.y+(l?a.y1:0)}).concat(j))).range([u,0]);if(e.domain()[0]===e.domain()[1]||f.domain()[0]===f.domain()[1])singlePoint=!0;e.domain()[0]===e.domain()[1]&&(e.domain()[0]?e.domain([e.domain()[0]-e.domain()[0]*.01,e.domain()[1]+e.domain()[1]*.01]):e.domain([-1,1])),f.domain()[0]===f.domain()[1]&&(f.domain()[0]?f.domain([f.domain()[0]+f.domain()[0]*.01,f.domain()[1]-f.domain()[1]*.01]):f.domain([-1,1])),r=r||e,s=s||f;var z=v.selectAll("g.nv-wrap.nv-multibar").data([a]),A=z.enter().append("g").attr("class","nvd3 nv-wrap nv-multibar"),B=A.append("defs"),C=A.append("g"),D=z.select("g");C.append("g").attr("class","nv-groups"),z.attr("transform","translate("+b.left+","+b.top+")"),B.append("clipPath").attr("id","nv-edge-clip-"+g).append("rect"),z.select("#nv-edge-clip-"+g+" rect").attr("width",t).attr("height",u),D.attr("clip-path",k?"url(#nv-edge-clip-"+g+")":"");var E=z.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a){return a.key});E.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),d3.transition(E.exit()).selectAll("rect.nv-bar").delay(function(b,c){return c*n/a[0].values.length}).attr("y",function(a){return l?s(a.y0):s(0)}).attr("height",0).remove(),E.attr("class",function(a,b){return"nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}).style("fill",function(a,b){return m(a,b)}).style("stroke",function(a,b){return m(a,b)}),d3.transition(E).style("stroke-opacity",1).style("fill-opacity",.75);var F=E.selectAll("rect.nv-bar").data(function(a){return a.values});F.exit().remove();var G=F.enter().append("rect").attr("class",function(a,b){return i(a,b)<0?"nv-bar negative":"nv-bar positive"}).attr("x",function(b,c,d){return l?0:d*e.rangeBand()/a.length}).attr("y",function(a){return s(l?a.y0:0)}).attr("height",0).attr("width",e.rangeBand()/(l?1:a.length));F.style("fill",function(a,b,c){return m(a,c,b)}).style("stroke",function(a,b,c){return m(a,c,b)}).on("mouseover",function(b,c){d3.select(this).classed("hover",!0),q.elementMouseover({value:i(b,c),point:b,series:a[b.series],pos:[e(h(b,c))+e.rangeBand()*(l?a.length/2:b.series+.5)/a.length,f(i(b,c)+(l?b.y0:0))],pointIndex:c,seriesIndex:b.series,e:d3.event})}).on("mouseout",function(b,c){d3.select(this).classed("hover",!1),q.elementMouseout({value:i(b,c),point:b,series:a[b.series],pointIndex:c,seriesIndex:b.series,e:d3.event})}).on("click",function(b,c){q.elementClick({value:i(b,c),point:b,series:a[b.series],pos:[e(h(b,c))+e.rangeBand()*(l?a.length/2:b.series+.5)/a.length,f(i(b,c)+(l?b.y0:0))],pointIndex:c,seriesIndex:b.series,e:d3.event}),d3.event.stopPropagation()}).on("dblclick",function(b,c){q.elementDblClick({value:i(b,c),point:b,series:a[b.series],pos:[e(h(b,c))+e.rangeBand()*(l?a.length/2:b.series+.5)/a.length,f(i(b,c)+(l?b.y0:0))],pointIndex:c,seriesIndex:b.series,e:d3.event}),d3.event.stopPropagation()}),F.attr("class",function(a,b){return i(a,b)<0?"nv-bar negative":"nv-bar positive"}).attr("transform",function(a,b){return"translate("+e(h(a,b))+",0)"}),l?d3.transition(F).delay(function(b,c){return c*n/a[0].values.length}).attr("y",function(a,b){return f(l?a.y1:0)}).attr("height",function(a,b){return Math.max(Math.abs(f(a.y+(l?a.y0:0))-f(l?a.y0:0)),1)}).each("end",function(){d3.transition(d3.select(this)).attr("x",function(b,c){return l?0:b.series*e.rangeBand()/a.length}).attr("width",e.rangeBand()/(l?1:a.length))}):d3.transition(F).delay(function(b,c){return c*n/a[0].values.length}).attr("x",function(b,c){return b.series*e.rangeBand()/a.length}).attr("width",e.rangeBand()/a.length).each("end",function(){d3.transition(d3.select(this)).attr("y",function(a,b){return i(a,b)<0?f(0):f(0)-f(i(a,b))<1?f(0)-1:f(i(a,b))}).attr("height",function(a,b){return Math.max(Math.abs(f(i(a,b))-f(0)),1)})}),r=e.copy(),s=f.copy()});return t}var b={top:0,right:0,bottom:0,left:0},c=960,d=500,e=d3.scale.ordinal(),f=d3.scale.linear(),g=Math.floor(Math.random()*1e4),h=function(a){return a.x},i=function(a){return a.y},j=[0],k=!0,l=!1,m=a.utils.defaultColor(),n=1200,o,p,q=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout"),r,s;t.dispatch=q,t.x=function(a){if(!arguments.length)return h;h=a;return t},t.y=function(a){if(!arguments.length)return i;i=a;return t},t.margin=function(a){if(!arguments.length)return b;b.top=typeof a.top!="undefined"?a.top:b.top,b.right=typeof a.right!="undefined"?a.right:b.right,b.bottom=typeof a.bottom!="undefined"?a.bottom:b.bottom,b.left=typeof a.left!="undefined"?a.left:b.left;return t},t.width=function(a){if(!arguments.length)return c;c=a;return t},t.height=function(a){if(!arguments.length)return d;d=a;return t},t.xScale=function(a){if(!arguments.length)return e;e=a;return t},t.yScale=function(a){if(!arguments.length)return f;f=a;return t},t.xDomain=function(a){if(!arguments.length)return o;o=a;return t},t.yDomain=function(a){if(!arguments.length)return p;p=a;return t},t.forceY=function(a){if(!arguments.length)return j;j=a;return t},t.stacked=function(a){if(!arguments.length)return l;l=a;return t},t.clipEdge=function(a){if(!arguments.length)return k;k=a;return t},t.color=function(b){if(!arguments.length)return m;m=a.utils.getColor(b);return t},t.id=function(a){if(!arguments.length)return g;g=a;return t},t.delay=function(a){if(!arguments.length)return n;n=a;return t};return t},a.models.multiBarChart=function(){function w(a){a.each(function(p){var z=d3.select(this),A=this,B=(h||parseInt(z.style("width"))||960)-g.left-g.right,C=(i||parseInt(z.style("height"))||400)-g.top-g.bottom;w.update=function(){a.transition().call(w)},w.container=this;if(!p||!p.length||!p.filter(function(a){return a.values.length}).length){var D=z.selectAll(".nv-noData").data([t]);D.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),D.attr("x",g.left+B/2).attr("y",g.top+C/2).text(function(a){return a});return w}z.selectAll(".nv-noData").remove(),q=b.xScale(),r=b.yScale();var E=z.selectAll("g.nv-wrap.nv-multiBarWithLegend").data([p]),F=E.enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarWithLegend").append("g"),G=E.select("g");F.append("g").attr("class","nv-x nv-axis"),F.append("g").attr("class","nv-y nv-axis"),F.append("g").attr("class","nv-barsWrap"),F.append("g").attr("class","nv-legendWrap"),F.append("g").attr("class","nv-controlsWrap"),l&&(e.width(B/2),G.select(".nv-legendWrap").datum(p).call(e),g.top!=e.height()&&(g.top=e.height(),C=(i||parseInt(z.style("height"))||400)-g.top-g.bottom),G.select(".nv-legendWrap").attr("transform","translate("+B/2+","+ -g.top+")"));if(k){var H=[{key:"Grouped",disabled:b.stacked()},{key:"Stacked",disabled:!b.stacked()}];f.width(180).color(["#444","#444","#444"]),G.select(".nv-controlsWrap").datum(H).attr("transform","translate(0,"+ -g.top+")").call(f)}E.attr("transform","translate("+g.left+","+g.top+")"),b.width(B).height(C).color(p.map(function(a,b){return a.color||j(a,b)}).filter(function(a,b){return!p[b].disabled}));var I=G.select(".nv-barsWrap").datum(p.filter(function(a){return!a.disabled}));d3.transition(I).call(b),c.scale(q).ticks(B/100).tickSize(-C,0),G.select(".nv-x.nv-axis").attr("transform","translate(0,"+r.range()[0]+")"),d3.transition(G.select(".nv-x.nv-axis")).call(c);var J=G.select(".nv-x.nv-axis > g").selectAll("g");J.selectAll("line, text").style("opacity",1),m&&J.filter(function(a,b){return b%Math.ceil(p[0].values.length/(B/100))!==0}).selectAll("text, line").style("opacity",0),n&&J.selectAll("text").attr("transform",function(a,b,c){return"rotate("+n+" 0,0)"}).attr("text-transform",n>0?"start":"end"),G.select(".nv-x.nv-axis").selectAll("g.nv-axisMaxMin text").style("opacity",1),d.scale(r).ticks(C/36).tickSize(-B,0),d3.transition(G.select(".nv-y.nv-axis")).call(d),e.dispatch.on("legendClick",function(b,c){b.disabled=!b.disabled,p.filter(function(a){return!a.disabled}).length||p.map(function(a){a.disabled=!1,E.selectAll(".nv-series").classed("disabled",!1);return a}),s.disabled=p.map(function(a){return!!a.disabled}),u.stateChange(s),a.transition().call(w)}),f.dispatch.on("legendClick",function(c,d){if(!!c.disabled){H=H.map(function(a){a.disabled=!0;return a}),c.disabled=!1;switch(c.key){case"Grouped":b.stacked(!1);break;case"Stacked":b.stacked(!0)}s.stacked=b.stacked(),u.stateChange(s),a.transition().call(w)}}),u.on("tooltipShow",function(a){o&&v(a,A.parentNode)}),u.on("changeState",function(c){typeof c.disabled!="undefined"&&(p.forEach(function(a,b){a.disabled=c.disabled[b]}),s.disabled=c.disabled),typeof c.stacked!="undefined"&&(b.stacked(c.stacked),s.stacked=c.stacked),a.call(w)})});return w}var b=a.models.multiBar(),c=a.models.axis(),d=a.models.axis(),e=a.models.legend(),f=a.models.legend(),g={top:30,right:20,bottom:30,left:60},h=null,i=null,j=a.utils.defaultColor(),k=!0,l=!0,m=!0,n=0,o=!0,p=function(a,b,c,d,e){return"

"+a+"

"+"

"+c+" on "+b+"

"},q,r,s={stacked:!1},t="No Data Available.",u=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState");b.stacked(!1),c.orient("bottom").tickPadding(7).highlightZero(!1).showMaxMin(!1).tickFormat(function(a){return a}),d.orient("left").tickFormat(d3.format(",.1f"));var v=function(e,f){var g=e.pos[0]+(f.offsetLeft||0),h=e.pos[1]+(f.offsetTop||0),i=c.tickFormat()(b.x()(e.point,e.pointIndex)),j=d.tickFormat()(b.y()(e.point,e.pointIndex)),k=p(e.series.key,i,j,e,w);a.tooltip.show([g,h],k,e.value<0?"n":"s",null,f)};b.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+g.left,a.pos[1]+g.top],u.tooltipShow(a)}),b.dispatch.on("elementMouseout.tooltip",function(a){u.tooltipHide(a)}),u.on("tooltipHide",function(){o&&a.tooltip.cleanup()}),w.dispatch=u,w.multibar=b,w.legend=e,w.xAxis=c,w.yAxis=d,d3.rebind(w,b,"x","y","xDomain","yDomain","forceX","forceY","clipEdge","id","stacked","delay"),w.margin=function(a){if(!arguments.length)return g;g.top=typeof a.top!="undefined"?a.top:g.top,g.right=typeof a.right!="undefined"?a.right:g.right,g.bottom=typeof a.bottom!="undefined"?a.bottom:g.bottom,g.left=typeof a.left!="undefined"?a.left:g.left;return w},w.width=function(a){if(!arguments.length)return h;h=a;return w},w.height=function(a){if(!arguments.length)return i;i=a;return w},w.color=function(b){if(!arguments.length)return j;j=a.utils.getColor(b),e.color(j);return w},w.showControls=function(a){if(!arguments.length)return k;k=a;return w},w.showLegend=function(a){if(!arguments.length)return l;l=a;return w},w.reduceXTicks=function(a){if(!arguments.length)return m;m=a;return w},w.rotateLabels=function(a){if(!arguments.length)return n;n=a;return w},w.tooltip=function(a){if(!arguments.length)return p;p=a;return w},w.tooltips=function(a){if(!arguments.length)return o;o=a;return w},w.tooltipContent=function(a){if(!arguments.length)return p;p=a;return w},w.state=function(a){if(!arguments.length)return s;s=a;return w},w.noData=function(a){if(!arguments.length)return t;t=a;return w};return w},a.models.multiBarHorizontal=function(){function w(a){a.each(function(a){var e=c-b.left-b.right,q=d-b.top-b.bottom,w=d3.select(this);m&&(a=d3.layout.stack().offset("zero").values(function(a){return a.values}).y(i)(a)),a=a.map(function(a,b){a.values=a.values.map(function(a){a.series=b;return a});return a}),m&&a[0].values.map(function(b,c){var d=0,e=0;a.map(function(a){var b=a.values[c];b.size=Math.abs(b.y),b.y<0?(b.y1=e-b.size,e=e-b.size):(b.y1=d,d=d+b.size)})});var z=r&&s?[]:a.map(function(a){return a.values.map(function(a,b){return{x:h(a,b),y:i(a,b),y0:a.y0,y1:a.y1}})});f.domain(r||d3.merge(z).map(function(a){return a.x})).rangeBands([0,q],.1),g.domain(s||d3.extent(d3.merge(z).map(function(a){return m?a.y>0?a.y1+a.y:a.y1:a.y}).concat(j))),n&&!m?g.range([g.domain()[0]<0?o:0,e-(g.domain()[1]>0?o:0)]):g.range([0,e]),u=u||f,v=v||d3.scale.linear().domain(g.domain()).range([g(0),g(0)]);var A=d3.select(this).selectAll("g.nv-wrap.nv-multibarHorizontal").data([a]),B=A.enter().append("g").attr("class","nvd3 nv-wrap nv-multibarHorizontal"),C=B.append("defs"),D=B.append("g"),E=A.select("g");D.append("g").attr("class","nv-groups"),A.attr("transform","translate("+b.left+","+b.top+")");var F=A.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a){return a.key});F.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),d3.transition(F.exit()).style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),F.attr("class",function(a,b){return"nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}).style("fill",function(a,b){return k(a,b)}).style("stroke",function(a,b){return k(a,b)}),d3.transition(F).style("stroke-opacity",1).style("fill-opacity",.75);var G=F.selectAll("g.nv-bar").data(function(a){return a.values});G.exit().remove();var H=G.enter().append("g").attr("transform",function(b,c,d){return"translate("+v(m?b.y0:0)+","+(m?0:d*f.rangeBand()/a.length+f(h(b,c)))+")"});H.append("rect").attr("width",0).attr("height",f.rangeBand()/(m?1:a.length)),G.on("mouseover",function(b,c){d3.select(this).classed("hover",!0),t.elementMouseover({value:i(b,c),point:b,series:a[b.series],pos:[g(i(b,c)+(m?b.y0:0)),f(h(b,c))+f.rangeBand()*(m?a.length/2:b.series+.5)/a.length],pointIndex:c,seriesIndex:b.series,e:d3.event})}).on("mouseout",function(b,c){d3.select(this).classed("hover",!1),t.elementMouseout({value:i(b,c),point:b,series:a[b.series],pointIndex:c,seriesIndex:b.series,e:d3.event})}).on("click",function(b,c){t.elementClick({value:i(b,c),point:b,series:a[b.series],pos:[f(h(b,c))+f.rangeBand()*(m?a.length/2:b.series+.5)/a.length,g(i(b,c)+(m?b.y0:0))],pointIndex:c,seriesIndex:b.series,e:d3.event}),d3.event.stopPropagation()}).on("dblclick",function(b,c){t.elementDblClick({value:i(b,c),point:b,series:a[b.series],pos:[f(h(b,c))+f.rangeBand()*(m?a.length/2:b.series+.5)/a.length,g(i(b,c)+(m?b.y0:0))],pointIndex:c,seriesIndex:b.series,e:d3.event}),d3.event.stopPropagation()}),H.append("text"),n&&!m?(G.select("text").attr("text-anchor",function(a,b){return i(a,b)<0?"end":"start"}).attr("y",f.rangeBand()/(a.length*2)).attr("dy",".32em").text(function(a,b){return p(i(a,b))}),d3.transition(G).select("text").attr("x",function(a,b){return i(a,b)<0?-4:g(i(a,b))-g(0)+4})):G.selectAll("text").text(""),G.attr("class",function(a,b){return i(a,b)<0?"nv-bar negative":"nv-bar positive"}),l&&G.style("fill",l).style("stroke",l),m?d3.transition(G).attr("transform",function(a,b){return"translate("+g(a.y1)+","+f(h(a,b))+")"}).select("rect").attr("width",function(a,b){return Math.abs(g(i(a,b)+a.y0)-g(a.y0))}).attr("height",f.rangeBand()):d3.transition(G).attr("transform",function(b,c){return"translate("+(i(b,c)<0?g(i(b,c)):g(0))+","+(b.series*f.rangeBand()/a.length+f(h(b,c)))+")"}).select("rect").attr("height",f.rangeBand()/a.length).attr("width",function(a,b){return Math.max(Math.abs(g(i(a,b))-g(0)),1)}),u=f.copy(),v=g.copy()});return w}var b={top:0,right:0,bottom:0,left:0},c=960,d=500,e=Math.floor(Math.random()*1e4),f=d3.scale.ordinal(),g=d3.scale.linear(),h=function(a){return a.x},i=function(a){return a.y},j=[0],k=a.utils.defaultColor(),l=null,m=!1,n=!1,o=60,p=d3.format(",.2f"),q=1200,r,s,t=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout"),u,v;w.dispatch=t,w.x=function(a){if(!arguments.length)return h;h=a;return w},w.y=function(a){if(!arguments.length)return i;i=a;return w},w.margin=function(a){if(!arguments.length)return b;b.top=typeof a.top!="undefined"?a.top:b.top,b.right=typeof a.right!="undefined"?a.right:b.right,b.bottom=typeof a.bottom!="undefined"?a.bottom:b.bottom,b.left=typeof a.left!="undefined"?a.left:b.left;return w},w.width=function(a){if(!arguments.length)return c;c=a;return w},w.height=function(a){if(!arguments.length)return d;d=a;return w},w.xScale=function(a){if(!arguments.length)return f;f=a;return w},w.yScale=function(a){if(!arguments.length)return g;g=a;return w},w.xDomain=function(a){if(!arguments.length)return r;r=a;return w},w.yDomain=function(a){if(!arguments.length)return s;s=a;return w},w.forceY=function(a){if(!arguments.length)return j;j=a;return w},w.stacked=function(a){if(!arguments.length)return m;m=a;return w},w.color=function(b){if(!arguments.length)return k;k=a.utils.getColor(b);return w},w.barColor=function(b){if(!arguments.length)return l;l=a.utils.getColor(b);return w},w.id=function(a){if(!arguments.length)return e;e=a;return w},w.delay=function(a){if(!arguments.length)return q;q=a;return w},w.showValues=function(a){if(!arguments.length)return n;n=a;return w},w.valueFormat=function(a){if(!arguments.length)return p;p=a;return w},w.valuePadding=function(a){if(!arguments.length)return o;o=a;return w};return w},a.models.multiBarHorizontalChart=function(){function v(a){a.each(function(m){var o=d3.select(this),w=this,z=(h||parseInt(o.style("width"))||960)-g.left-g.right,A=(i||parseInt(o.style("height"))||400)-g.top-g.bottom;v.update=function(){a.transition().call(v)},v.container=this;if(!m||!m.length||!m.filter(function(a){return a.values.length}).length){var B=o.selectAll(".nv-noData").data([s]);B.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),B.attr("x",g.left+z/2).attr("y",g.top+A/2).text(function(a){return a});return v}o.selectAll(".nv-noData").remove(),p=b.xScale(),q=b.yScale();var C=o.selectAll("g.nv-wrap.nv-multiBarHorizontalChart").data([m]),D=C.enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarHorizontalChart").append("g"),E=C.select("g");D.append("g").attr("class","nv-x nv-axis"),D.append("g").attr("class","nv-y nv-axis"),D.append("g").attr("class","nv-barsWrap"),D.append("g").attr("class","nv-legendWrap"),D.append("g").attr("class","nv-controlsWrap"),l&&(e.width(z/2),E.select(".nv-legendWrap").datum(m).call(e),g.top!=e.height()&&(g.top=e.height(),A=(i||parseInt(o.style("height"))||400)-g.top-g.bottom),E.select(".nv-legendWrap").attr("transform","translate("+z/2+","+ -g.top+")"));if(k){var F=[{key:"Grouped",disabled:b.stacked()},{key:"Stacked",disabled:!b.stacked()}];f.width(180).color(["#444","#444","#444"]),E.select(".nv-controlsWrap").datum(F).attr("transform","translate(0,"+ -g.top+")").call(f)}C.attr("transform","translate("+g.left+","+g.top+")"),b.width(z).height(A).color(m.map(function(a,b){return a.color||j(a,b)}).filter(function(a,b){return!m[b].disabled}));var G=E.select(".nv-barsWrap").datum(m.filter(function(a){return!a.disabled}));d3.transition(G).call(b),c.scale(p).ticks(A/24).tickSize(-z,0),d3.transition(E.select(".nv-x.nv-axis")).call(c);var H=E.select(".nv-x.nv-axis").selectAll("g");H.selectAll("line, text").style("opacity",1),d.scale(q).ticks(z/100).tickSize(-A,0),E.select(".nv-y.nv-axis").attr("transform","translate(0,"+A+")"),d3.transition(E.select(".nv-y.nv-axis")).call(d),e.dispatch.on("legendClick",function(b,c){b.disabled=!b.disabled,m.filter(function(a){return!a.disabled}).length||m.map(function(a){a.disabled=!1,C.selectAll(".nv-series").classed("disabled",!1);return a}),r.disabled=m.map(function(a){return!!a.disabled}),t.stateChange(r),a.transition().call(v)}),f.dispatch.on("legendClick",function(c,d){if(!!c.disabled){F=F.map(function(a){a.disabled=!0;return a}),c.disabled=!1;switch(c.key){case"Grouped":b.stacked(!1);break;case"Stacked":b.stacked(!0)}r.stacked=b.stacked(),t.stateChange(r),a.transition().call(v)}}),t.on("tooltipShow",function(a){n&&u(a,w.parentNode)}),t.on("changeState",function(c){typeof c.disabled!="undefined"&&(m.forEach(function(a,b){a.disabled=c.disabled[b]}),r.disabled=c.disabled),typeof c.stacked!="undefined"&&(b.stacked(c.stacked),r.stacked=c.stacked),a.call(v)})});return v}var b=a.models.multiBarHorizontal(),c=a.models.axis(),d=a.models.axis(),e=a.models.legend().height(30),f=a.models.legend().height(30),g={top:30,right:20,bottom:50,left:60},h=null,i=null,j=a.utils.defaultColor(),k=!0,l=!0,m=!1,n=!0,o=function(a,b,c,d,e){return"

"+a+" - "+b+"

"+"

"+c+"

"},p,q,r={stacked:m},s="No Data Available.",t=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState");b.stacked(m),c.orient("left").tickPadding(5).highlightZero(!1).showMaxMin(!1).tickFormat(function(a){return a}),d.orient("bottom").tickFormat(d3.format(",.1f"));var u=function(e,f){var g=e.pos[0]+(f.offsetLeft||0),h=e.pos[1]+(f.offsetTop||0),i=c.tickFormat()(b.x()(e.point,e.pointIndex)),j=d.tickFormat()(b.y()(e.point,e.pointIndex)),k=o(e.series.key,i,j,e,v);a.tooltip.show([g,h],k,e.value<0?"e":"w",null,f)};b.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+g.left,a.pos[1]+g.top],t.tooltipShow(a)}),b.dispatch.on("elementMouseout.tooltip",function(a){t.tooltipHide(a)}),t.on("tooltipHide",function(){n&&a.tooltip.cleanup()}),v.dispatch=t,v.multibar=b,v.legend=e,v.xAxis=c,v.yAxis=d,d3.rebind(v,b,"x","y","xDomain","yDomain","forceX","forceY","clipEdge","id","delay","showValues","valueFormat","stacked"),v.margin=function(a){if(!arguments.length)return g;g.top=typeof a.top!="undefined"?a.top:g.top,g.right=typeof a.right!="undefined"?a.right:g.right,g.bottom=typeof a.bottom!="undefined"?a.bottom:g.bottom,g.left=typeof a.left!="undefined"?a.left:g.left;return v},v.width=function(a){if(!arguments.length)return h;h=a;return v},v.height=function(a){if(!arguments.length)return i;i=a;return v},v.color=function(b){if(!arguments.length)return j;j=a.utils.getColor(b),e.color(j);return v},v.showControls=function(a){if(!arguments.length)return k;k=a;return v},v.showLegend=function(a){if(!arguments.length)return l;l=a;return v},v.tooltip=function(a){if(!arguments.length)return o;o=a;return v},v.tooltips=function(a){if(!arguments.length)return n;n=a;return v},v.tooltipContent=function(a){if(!arguments.length)return o;o=a;return v},v.state=function(a){if(!arguments.length)return r;r=a;return v},v.noData=function(a){if(!arguments.length)return s;s=a;return v};return v},a.models.multiChart=function(){function y(a){a.each(function(h){var j=d3.select(this),z=this,A=(d||parseInt(j.style("width"))||960)-b.left-b.right,B=(e||parseInt(j.style("height"))||400)-b.top-b.bottom,C=h.filter(function(a){return!a.disabled&&a.type=="line"&&a.yAxis==1}),D=h.filter(function(a){return!a.disabled&&a.type=="line"&&a.yAxis==2}),E=h.filter(function(a){return!a.disabled&&a.type=="bar"&&a.yAxis==1}),F=h.filter(function(a){return!a.disabled&&a.type=="bar"&&a.yAxis==2}),G=h.filter(function(a){return!a.disabled&&a.type=="area"&&a.yAxis==1}),H=h.filter(function(a){return!a.disabled&&a.type=="area"&&a.yAxis==2}),I=h.filter(function(a){return!a.disabled&&a.yAxis==1}).map(function(a){return a.values.map(function(a,b){return{x:a.x,y:a.y}})}),J=h.filter(function(a){return!a.disabled&&a.yAxis==2}).map(function(a){return a.values.map(function(a,b){return{x:a.x,y:a.y}})});i.domain(d3.extent(d3.merge(I.concat(J)),function(a){return a.x})).range([0,A]);var K=j.selectAll("g.wrap.multiChart").data([h]),L=K.enter().append("g").attr("class","wrap nvd3 multiChart").append("g");L.append("g").attr("class","x axis"),L.append("g").attr("class","y1 axis"),L.append("g").attr("class","y2 axis"),L.append("g").attr("class","lines1Wrap"),L.append("g").attr("class","lines2Wrap"),L.append("g").attr("class","bars1Wrap"),L.append("g").attr("class","bars2Wrap"),L.append("g").attr("class","stack1Wrap"),L.append("g").attr("class","stack2Wrap"),L.append("g").attr("class","legendWrap");var M=K.select("g");f&&(v.width(A/2),M.select(".legendWrap").datum(h.map(function(a){a.originalKey=a.originalKey===undefined?a.key:a.originalKey,a.key=a.originalKey+(a.yAxis==1?"":" (right axis)");return a})).call(v),b.top!=v.height()&&(b.top=v.height(),B=(e||parseInt(j.style("height"))||400)-b.top-b.bottom),M.select(".legendWrap").attr("transform","translate("+A/2+","+ -b.top+")")),m.width(A).height(B).interpolate("monotone").color(h.map(function(a,b){return a.color||c[b%c.length]}).filter(function(a,b){return!h[b].disabled&&h[b].yAxis==1&&h[b].type=="line"})),n.width(A).height(B).interpolate("monotone").color(h.map(function(a,b){return a.color||c[b%c.length]}).filter(function(a,b){return!h[b].disabled&&h[b].yAxis==2&&h[b].type=="line"})),o.width(A).height(B).color(h.map(function(a,b){return a.color||c[b%c.length]}).filter(function(a,b){return!h[b].disabled&&h[b].yAxis==1&&h[b].type=="bar"})),p.width(A).height(B).color(h.map(function(a,b){return a.color||c[b%c.length]}).filter(function(a,b){return!h[b].disabled&&h[b].yAxis==2&&h[b].type=="bar"})),q.width(A).height(B).color(h.map(function(a,b){return a.color||c[b%c.length]}).filter(function(a,b){return!h[b].disabled&&h[b].yAxis==1&&h[b].type=="area"})),r.width(A).height(B).color(h.map(function(a,b){return a.color||c[b%c.length]}).filter(function(a,b){return!h[b].disabled&&h[b].yAxis==2&&h[b].type=="area"})),M.attr("transform","translate("+b.left+","+b.top+")");var N=M.select(".lines1Wrap").datum(C),O=M.select(".bars1Wrap").datum(E),P=M.select(".stack1Wrap").datum(G),Q=M.select(".lines2Wrap").datum(D),R=M.select(".bars2Wrap").datum(F),S=M.select(".stack2Wrap").datum(H),T=G.length?G.map(function(a){return a.values}).reduce(function(a,b){return a.map(function(a,c){return{x:a.x,y:a.y+b[c].y}})}).concat([{x:0,y:0}]):[],U=H.length?H.map(function(a){return a.values}).reduce(function(a,b){return a.map(function(a,c){return{x:a.x,y:a.y+b[c].y}})}).concat([{x:0,y:0}]):[];k.domain(d3.extent(d3.merge(I).concat(T),function(a){return a.y})).range([0,B]),l.domain(d3.extent(d3.merge(J).concat(U),function(a){return a.y})).range([0,B]),m.yDomain(k.domain()),o.yDomain(k.domain()),q.yDomain(k.domain()),n.yDomain(l.domain()),p.yDomain(l.domain()),r.yDomain(l.domain()),G.length&&d3.transition(P).call(q),H.length&&d3.transition(S).call(r),E.length&&d3.transition(O).call(o),F.length&&d3.transition(R).call(p),C.length&&d3.transition(N).call(m),D.length&&d3.transition(Q).call(n),s.ticks(A/100).tickSize(-B,0),M.select(".x.axis").attr("transform","translate(0,"+B+")"),d3.transition(M.select(".x.axis")).call(s),t.ticks(B/36).tickSize(-A,0),d3.transition(M.select(".y1.axis")).call(t),u.ticks(B/36).tickSize(-A,0),d3.transition(M.select(".y2.axis")).call(u),M.select(".y2.axis").style("opacity",J.length?1:0).attr("transform","translate("+i.range()[1]+",0)"),v.dispatch.on("legendClick",function(b,c){b.disabled=!b.disabled,h.filter(function(a){return!a.disabled}).length||h.map(function(a){a.disabled=!1,K.selectAll(".series").classed("disabled",!1);return a}),a.transition().call(y)}),w.on("tooltipShow",function(a){g&&x(a,z.parentNode)})}),y.update=function(){y(a)},y.container=this;return y}var b={top:30,right:20,bottom:50,left:60},c=d3.scale.category20().range(),d=null,e=null,f=!0,g=!0,h=function(a,b,c,d,e){return"

"+a+"

"+"

"+c+" at "+b+"

"},i,j,i=d3.scale.linear(),k=d3.scale.linear(),l=d3.scale.linear(),m=a.models.line().yScale(k),n=a.models.line().yScale(l),o=a.models.multiBar().stacked(!1).yScale(k),p=a.models.multiBar().stacked(!1).yScale(l),q=a.models.stackedArea().yScale(k),r=a.models.stackedArea().yScale(l),s=a.models.axis().scale(i).orient("bottom").tickPadding(5),t=a.models.axis().scale(k).orient("left"),u=a.models.axis().scale(l).orient("right"),v=a.models.legend().height(30),w=d3.dispatch("tooltipShow","tooltipHide"),x=function(b,c){var d=b.pos[0]+(c.offsetLeft||0),e=b.pos[1]+(c.offsetTop||0),f=s.tickFormat()(m.x()(b.point,b.pointIndex)),g=(b.series.bar?t:u).tickFormat()(m.y()(b.point,b.pointIndex)),i=h(b.series.key,f,g,b,y);a.tooltip.show([d,e],i,undefined,undefined,c.offsetParent)};m.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+b.left,a.pos[1]+b.top],w.tooltipShow(a)}),m.dispatch.on("elementMouseout.tooltip",function(a){w.tooltipHide(a)}),n.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+b.left,a.pos[1]+b.top],w.tooltipShow(a)}),n.dispatch.on("elementMouseout.tooltip",function(a){w.tooltipHide(a)}),o.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+b.left,a.pos[1]+b.top],w.tooltipShow(a)}),o.dispatch.on("elementMouseout.tooltip",function(a){w.tooltipHide(a)}),p.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+b.left,a.pos[1]+b.top],w.tooltipShow(a)}),p.dispatch.on("elementMouseout.tooltip",function(a){w.tooltipHide(a)}),q.dispatch.on("tooltipShow",function(a){if(!Math.round(q.y()(a.point)*100)){setTimeout(function(){d3.selectAll(".point.hover").classed("hover",!1)},0);return!1}a.pos=[a.pos[0]+b.left,a.pos[1]+b.top],w.tooltipShow(a)}),q.dispatch.on("tooltipHide",function(a){w.tooltipHide(a)}),r.dispatch.on("tooltipShow",function(a){if(!Math.round(r.y()(a.point)*100)){setTimeout(function(){d3.selectAll(".point.hover").classed("hover",!1)},0);return!1}a.pos=[a.pos[0]+b.left,a.pos[1]+b.top],w.tooltipShow(a)}),r.dispatch.on("tooltipHide",function(a){w.tooltipHide(a)}),m.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+b.left,a.pos[1]+b.top],w.tooltipShow(a)}),m.dispatch.on("elementMouseout.tooltip",function(a){w.tooltipHide(a)}),n.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+b.left,a.pos[1]+b.top],w.tooltipShow(a)}),n.dispatch.on("elementMouseout.tooltip",function(a){w.tooltipHide(a)}),w.on("tooltipHide",function(){g&&a.tooltip.cleanup()}),y.dispatch=w,y.lines1=m,y.lines2=n,y.bars1=o,y.bars2=p,y.stack1=q,y.stack2=r,y.xAxis=s,y.yAxis1=t,y.yAxis2=u,y.x=function(a){if(!arguments.length)return getX;getX=a,m.x(a),o.x(a);return y},y.y=function(a){if(!arguments.length)return getY;getY=a,m.y(a),o.y(a);return y},y.margin=function(a){if(!arguments.length)return b;b=a;return y},y.width=function(a){if(!arguments.length)return d;d=a;return y},y.height=function(a){if(!arguments.length)return e;e=a;return y},y.color=function(a){if(!arguments.length)return c;c=a,v.color(a);return y},y.showLegend=function(a){if(!arguments.length)return f;f=a;return y},y.tooltips=function(a){if(!arguments.length)return g;g=a;return y},y.tooltipContent=function(a){if(!arguments.length)return h;h=a;return y};return y},a.models.ohlcBar=function(){function v(a){a.each(function(a){var r=c-b.left-b.right,v=d-b.top-b.bottom,w=d3.select(this);f.domain(s||d3.extent(a[0].values.map(h).concat(n))),p?f.range([r*.5/a[0].values.length,r*(a[0].values.length-.5)/a[0].values.length]):f.range([0,r]),g.domain(t||[d3.min(a[0].values.map(m).concat(o)),d3.max(a[0].values.map(l).concat(o))]).range([v,0]);if(f.domain()[0]===f.domain()[1]||g.domain()[0]=== -g.domain()[1])singlePoint=!0;f.domain()[0]===f.domain()[1]&&(f.domain()[0]?f.domain([f.domain()[0]-f.domain()[0]*.01,f.domain()[1]+f.domain()[1]*.01]):f.domain([-1,1])),g.domain()[0]===g.domain()[1]&&(g.domain()[0]?g.domain([g.domain()[0]+g.domain()[0]*.01,g.domain()[1]-g.domain()[1]*.01]):g.domain([-1,1]));var z=d3.select(this).selectAll("g.nv-wrap.nv-ohlcBar").data([a[0].values]),A=z.enter().append("g").attr("class","nvd3 nv-wrap nv-ohlcBar"),B=A.append("defs"),C=A.append("g"),D=z.select("g");C.append("g").attr("class","nv-ticks"),z.attr("transform","translate("+b.left+","+b.top+")"),w.on("click",function(a,b){u.chartClick({data:a,index:b,pos:d3.event,id:e})}),B.append("clipPath").attr("id","nv-chart-clip-path-"+e).append("rect"),z.select("#nv-chart-clip-path-"+e+" rect").attr("width",r).attr("height",v),D.attr("clip-path",q?"url(#nv-chart-clip-path-"+e+")":"");var E=z.select(".nv-ticks").selectAll(".nv-tick").data(function(a){return a});E.exit().remove();var F=E.enter().append("path").attr("class",function(a,b,c){return(j(a,b)>k(a,b)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+c+"-"+b}).attr("d",function(b,c){var d=r/a[0].values.length*.9;return"m0,0l0,"+(g(j(b,c))-g(l(b,c)))+"l"+ -d/2+",0l"+d/2+",0l0,"+(g(m(b,c))-g(j(b,c)))+"l0,"+(g(k(b,c))-g(m(b,c)))+"l"+d/2+",0l"+ -d/2+",0z"}).attr("transform",function(a,b){return"translate("+f(h(a,b))+","+g(l(a,b))+")"}).on("mouseover",function(b,c){d3.select(this).classed("hover",!0),u.elementMouseover({point:b,series:a[0],pos:[f(h(b,c)),g(i(b,c))],pointIndex:c,seriesIndex:0,e:d3.event})}).on("mouseout",function(b,c){d3.select(this).classed("hover",!1),u.elementMouseout({point:b,series:a[0],pointIndex:c,seriesIndex:0,e:d3.event})}).on("click",function(a,b){u.elementClick({value:i(a,b),data:a,index:b,pos:[f(h(a,b)),g(i(a,b))],e:d3.event,id:e}),d3.event.stopPropagation()}).on("dblclick",function(a,b){u.elementDblClick({value:i(a,b),data:a,index:b,pos:[f(h(a,b)),g(i(a,b))],e:d3.event,id:e}),d3.event.stopPropagation()});E.attr("class",function(a,b,c){return(j(a,b)>k(a,b)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+c+"-"+b}),d3.transition(E).attr("transform",function(a,b){return"translate("+f(h(a,b))+","+g(l(a,b))+")"}).attr("d",function(b,c){var d=r/a[0].values.length*.9;return"m0,0l0,"+(g(j(b,c))-g(l(b,c)))+"l"+ -d/2+",0l"+d/2+",0l0,"+(g(m(b,c))-g(j(b,c)))+"l0,"+(g(k(b,c))-g(m(b,c)))+"l"+d/2+",0l"+ -d/2+",0z"})});return v}var b={top:0,right:0,bottom:0,left:0},c=960,d=500,e=Math.floor(Math.random()*1e4),f=d3.scale.linear(),g=d3.scale.linear(),h=function(a){return a.x},i=function(a){return a.y},j=function(a){return a.open},k=function(a){return a.close},l=function(a){return a.high},m=function(a){return a.low},n=[],o=[],p=!1,q=!0,r=a.utils.defaultColor(),s,t,u=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout");v.dispatch=u,v.x=function(a){if(!arguments.length)return h;h=a;return v},v.y=function(a){if(!arguments.length)return i;i=a;return v},v.open=function(a){if(!arguments.length)return j;j=a;return v},v.close=function(a){if(!arguments.length)return k;k=a;return v},v.high=function(a){if(!arguments.length)return l;l=a;return v},v.low=function(a){if(!arguments.length)return m;m=a;return v},v.margin=function(a){if(!arguments.length)return b;b.top=typeof a.top!="undefined"?a.top:b.top,b.right=typeof a.right!="undefined"?a.right:b.right,b.bottom=typeof a.bottom!="undefined"?a.bottom:b.bottom,b.left=typeof a.left!="undefined"?a.left:b.left;return v},v.width=function(a){if(!arguments.length)return c;c=a;return v},v.height=function(a){if(!arguments.length)return d;d=a;return v},v.xScale=function(a){if(!arguments.length)return f;f=a;return v},v.yScale=function(a){if(!arguments.length)return g;g=a;return v},v.xDomain=function(a){if(!arguments.length)return s;s=a;return v},v.yDomain=function(a){if(!arguments.length)return t;t=a;return v},v.forceX=function(a){if(!arguments.length)return n;n=a;return v},v.forceY=function(a){if(!arguments.length)return o;o=a;return v},v.padData=function(a){if(!arguments.length)return p;p=a;return v},v.clipEdge=function(a){if(!arguments.length)return q;q=a;return v},v.color=function(b){if(!arguments.length)return r;r=a.utils.getColor(b);return v},v.id=function(a){if(!arguments.length)return e;e=a;return v};return v},a.models.pie=function(){function q(a){a.each(function(a){function G(a){a.innerRadius=0;var b=d3.interpolate({startAngle:0,endAngle:0},a);return function(a){return y(b(a))}}function F(a){n||(a.innerRadius=0);var b=d3.interpolate(this._current,a);this._current=b(0);return function(a){return y(b(a))}}function E(a){var b=(a.startAngle+a.endAngle)*90/Math.PI-90;return b>90?b-180:b}var j=c-b.left-b.right,q=d-b.top-b.bottom,r=Math.min(j,q)/2,s=r-r/5,t=d3.select(this),u=t.selectAll(".nv-wrap.nv-pie").data([e(a[0])]),v=u.enter().append("g").attr("class","nvd3 nv-wrap nv-pie nv-chart-"+h),w=v.append("g"),x=u.select("g");w.append("g").attr("class","nv-pie"),u.attr("transform","translate("+b.left+","+b.top+")"),x.select(".nv-pie").attr("transform","translate("+j/2+","+q/2+")"),t.on("click",function(a,b){p.chartClick({data:a,index:b,pos:d3.event,id:h})});var y=d3.svg.arc().outerRadius(s);n&&y.innerRadius(r/2);var z=d3.layout.pie().sort(null).value(function(a){return a.disabled?0:g(a)}),A=u.select(".nv-pie").selectAll(".nv-slice").data(z);A.exit().remove();var B=A.enter().append("g").attr("class","nv-slice").on("mouseover",function(a,b){d3.select(this).classed("hover",!0),p.elementMouseover({label:f(a.data),value:g(a.data),point:a.data,pointIndex:b,pos:[d3.event.pageX,d3.event.pageY],id:h})}).on("mouseout",function(a,b){d3.select(this).classed("hover",!1),p.elementMouseout({label:f(a.data),value:g(a.data),point:a.data,index:b,id:h})}).on("click",function(a,b){p.elementClick({label:f(a.data),value:g(a.data),point:a.data,index:b,pos:d3.event,id:h}),d3.event.stopPropagation()}).on("dblclick",function(a,b){p.elementDblClick({label:f(a.data),value:g(a.data),point:a.data,index:b,pos:d3.event,id:h}),d3.event.stopPropagation()});A.attr("fill",function(a,b){return i(a,b)}).attr("stroke",function(a,b){return i(a,b)});var C=B.append("path").each(function(a){this._current=a});d3.transition(A.select("path")).attr("d",y).attrTween("d",F);if(k){var D=y;l&&(D=d3.svg.arc().outerRadius(y.outerRadius())),B.append("g").classed("nv-label",!0).each(function(a,b){var c=d3.select(this);c.attr("transform",function(a){if(o){a.outerRadius=s+10,a.innerRadius=s+15;var b=(a.startAngle+a.endAngle)/2*(180/Math.PI);(a.startAngle+a.endAngle)/2m?f(a.data):""});var d=c.select("text").node().getBBox();c.select(".nv-label rect").attr("width",d.width+10).attr("height",d.height+10).attr("transform",function(){return"translate("+[d.x-5,d.y-5]+")"})})}});return q}var b={top:0,right:0,bottom:0,left:0},c=500,d=500,e=function(a){return a.values},f=function(a){return a.x},g=function(a){return a.y},h=Math.floor(Math.random()*1e4),i=a.utils.defaultColor(),j=d3.format(",.2f"),k=!0,l=!1,m=.02,n=!1,o=!1,p=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout");q.dispatch=p,q.margin=function(a){if(!arguments.length)return b;b.top=typeof a.top!="undefined"?a.top:b.top,b.right=typeof a.right!="undefined"?a.right:b.right,b.bottom=typeof a.bottom!="undefined"?a.bottom:b.bottom,b.left=typeof a.left!="undefined"?a.left:b.left;return q},q.width=function(a){if(!arguments.length)return c;c=a;return q},q.height=function(a){if(!arguments.length)return d;d=a;return q},q.values=function(a){if(!arguments.length)return e;e=a;return q},q.x=function(a){if(!arguments.length)return f;f=a;return q},q.y=function(a){if(!arguments.length)return g;g=d3.functor(a);return q},q.showLabels=function(a){if(!arguments.length)return k;k=a;return q},q.labelSunbeamLayout=function(a){if(!arguments.length)return o;o=a;return q},q.donutLabelsOutside=function(a){if(!arguments.length)return l;l=a;return q},q.donut=function(a){if(!arguments.length)return n;n=a;return q},q.id=function(a){if(!arguments.length)return h;h=a;return q},q.color=function(b){if(!arguments.length)return i;i=a.utils.getColor(b);return q},q.valueFormat=function(a){if(!arguments.length)return j;j=a;return q},q.labelThreshold=function(a){if(!arguments.length)return m;m=a;return q};return q},a.models.pieChart=function(){function o(a){a.each(function(h){var i=d3.select(this),j=this,n=(e||parseInt(i.style("width"))||960)-d.left-d.right,p=(f||parseInt(i.style("height"))||400)-d.top-d.bottom;o.update=function(){o(a)},o.container=this;if(!h||!h.length){var q=i.selectAll(".nv-noData").data([l]);q.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),q.attr("x",d.left+n/2).attr("y",d.top+p/2).text(function(a){return a});return o}i.selectAll(".nv-noData").remove();var r=i.selectAll("g.nv-wrap.nv-pieChart").data([h]),s=r.enter().append("g").attr("class","nvd3 nv-wrap nv-pieChart").append("g"),t=r.select("g");s.append("g").attr("class","nv-pieWrap"),s.append("g").attr("class","nv-legendWrap"),g&&(c.width(n).key(b.x()),r.select(".nv-legendWrap").datum(b.values()(h[0])).call(c),d.top!=c.height()&&(d.top=c.height(),p=(f||parseInt(i.style("height"))||400)-d.top-d.bottom),r.select(".nv-legendWrap").attr("transform","translate(0,"+ -d.top+")")),r.attr("transform","translate("+d.left+","+d.top+")"),b.width(n).height(p);var u=t.select(".nv-pieWrap").datum(h);d3.transition(u).call(b),c.dispatch.on("legendClick",function(c,d,e){c.disabled=!c.disabled,b.values()(h[0]).filter(function(a){return!a.disabled}).length||b.values()(h[0]).map(function(a){a.disabled=!1,r.selectAll(".nv-series").classed("disabled",!1);return a}),k.disabled=h[0].map(function(a){return!!a.disabled}),m.stateChange(k),a.transition().call(o)}),b.dispatch.on("elementMouseout.tooltip",function(a){m.tooltipHide(a)}),m.on("changeState",function(b){typeof b.disabled!="undefined"&&(h[0].forEach(function(a,c){a.disabled=b.disabled[c]}),k.disabled=b.disabled),a.call(o)})});return o}var b=a.models.pie(),c=a.models.legend(),d={top:30,right:20,bottom:20,left:20},e=null,f=null,g=!0,h=a.utils.defaultColor(),i=!0,j=function(a,b,c,d){return"

"+a+"

"+"

"+b+"

"},k={},l="No Data Available.",m=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),n=function(c,d){var e=c.pos[0]+(d&&d.offsetLeft||0),f=c.pos[1]+(d&&d.offsetTop||0),g=b.valueFormat()(b.y()(c.point)),h=j(b.x()(c.point),g,c,o);a.tooltip.show([e,f],h,c.value<0?"n":"s",null,d)};b.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+d.left,a.pos[1]+d.top],m.tooltipShow(a)}),m.on("tooltipShow",function(a){i&&n(a)}),m.on("tooltipHide",function(){i&&a.tooltip.cleanup()}),o.legend=c,o.dispatch=m,o.pie=b,d3.rebind(o,b,"valueFormat","values","x","y","id","showLabels","donutLabelsOutside","donut","labelThreshold"),o.margin=function(a){if(!arguments.length)return d;d.top=typeof a.top!="undefined"?a.top:d.top,d.right=typeof a.right!="undefined"?a.right:d.right,d.bottom=typeof a.bottom!="undefined"?a.bottom:d.bottom,d.left=typeof a.left!="undefined"?a.left:d.left;return o},o.width=function(a){if(!arguments.length)return e;e=a;return o},o.height=function(a){if(!arguments.length)return f;f=a;return o},o.color=function(d){if(!arguments.length)return h;h=a.utils.getColor(d),c.color(h),b.color(h);return o},o.showLegend=function(a){if(!arguments.length)return g;g=a;return o},o.tooltips=function(a){if(!arguments.length)return i;i=a;return o},o.tooltipContent=function(a){if(!arguments.length)return j;j=a;return o},o.state=function(a){if(!arguments.length)return k;k=a;return o},o.noData=function(a){if(!arguments.length)return l;l=a;return o};return o},a.models.scatter=function(){function J(a){a.each(function(a){function S(){if(!r)return!1;var e,i=d3.merge(a.map(function(a,b){return a.values.map(function(a,c){return[g(j(a,c))*(Math.random()/1e12+1),h(k(a,c))*(Math.random()/1e12+1),b,c,a]}).filter(function(a,b){return s(a[4],b)})}));if(D===!0){if(v){var l=N.select("defs").selectAll(".nv-point-clips").data([f]).enter();l.append("clipPath").attr("class","nv-point-clips").attr("id","nv-points-clip-"+f);var m=N.select("#nv-points-clip-"+f).selectAll("circle").data(i);m.enter().append("circle").attr("r",w),m.exit().remove(),m.attr("cx",function(a){return a[0]}).attr("cy",function(a){return a[1]}),N.select(".nv-point-paths").attr("clip-path","url(#nv-points-clip-"+f+")")}i.push([g.range()[0]-20,h.range()[0]-20,null,null]),i.push([g.range()[1]+20,h.range()[1]+20,null,null]),i.push([g.range()[0]-20,h.range()[0]+20,null,null]),i.push([g.range()[1]+20,h.range()[1]-20,null,null]);var n=d3.geom.polygon([[-10,-10],[-10,d+10],[c+10,d+10],[c+10,-10]]),o=d3.geom.voronoi(i).map(function(a,b){return{data:n.clip(a),series:i[b][2],point:i[b][3]}}),p=N.select(".nv-point-paths").selectAll("path").data(o);p.enter().append("path").attr("class",function(a,b){return"nv-path-"+b}),p.exit().remove(),p.attr("d",function(a){return"M"+a.data.join("L")+"Z"}),p.on("click",function(c){if(I)return 0;var d=a[c.series],e=d.values[c.point];C.elementClick({point:e,series:d,pos:[g(j(e,c.point))+b.left,h(k(e,c.point))+b.top],seriesIndex:c.series,pointIndex:c.point})}).on("mouseover",function(c){if(I)return 0;var d=a[c.series],e=d.values[c.point];C.elementMouseover({point:e,series:d,pos:[g(j(e,c.point))+b.left,h(k(e,c.point))+b.top],seriesIndex:c.series,pointIndex:c.point})}).on("mouseout",function(b,c){if(I)return 0;var d=a[b.series],e=d.values[b.point];C.elementMouseout({point:e,series:d,seriesIndex:b.series,pointIndex:b.point})})}else N.select(".nv-groups").selectAll(".nv-group").selectAll(".nv-point").on("click",function(c,d){if(I)return 0;var e=a[c.series],f=e.values[d];C.elementClick({point:f,series:e,pos:[g(j(f,d))+b.left,h(k(f,d))+b.top],seriesIndex:c.series,pointIndex:d})}).on("mouseover",function(c,d){if(I)return 0;var e=a[c.series],f=e.values[d];C.elementMouseover({point:f,series:e,pos:[g(j(f,d))+b.left,h(k(f,d))+b.top],seriesIndex:c.series,pointIndex:d})}).on("mouseout",function(b,c){if(I)return 0;var d=a[b.series],e=d.values[c];C.elementMouseout({point:e,series:d,seriesIndex:b.series,pointIndex:c})});I=!1}var J=c-b.left-b.right,K=d-b.top-b.bottom,L=d3.select(this);a=a.map(function(a,b){a.values=a.values.map(function(a){a.series=b;return a});return a});var M=x&&y&&z?[]:d3.merge(a.map(function(a){return a.values.map(function(a,b){return{x:j(a,b),y:k(a,b),size:l(a,b)}})}));g.domain(x||d3.extent(M.map(function(a){return a.x}).concat(o))),t?g.range([J*.5/a[0].values.length,J*(a[0].values.length-.5)/a[0].values.length]):g.range([0,J]),h.domain(y||d3.extent(M.map(function(a){return a.y}).concat(p))).range([K,0]),i.domain(z||d3.extent(M.map(function(a){return a.size}).concat(q))).range(A||[16,256]);if(g.domain()[0]===g.domain()[1]||h.domain()[0]===h.domain()[1])B=!0;g.domain()[0]===g.domain()[1]&&(g.domain()[0]?g.domain([g.domain()[0]-g.domain()[0]*.01,g.domain()[1]+g.domain()[1]*.01]):g.domain([-1,1])),h.domain()[0]===h.domain()[1]&&(h.domain()[0]?h.domain([h.domain()[0]+h.domain()[0]*.01,h.domain()[1]-h.domain()[1]*.01]):h.domain([-1,1])),E=E||g,F=F||h,G=G||i;var N=L.selectAll("g.nv-wrap.nv-scatter").data([a]),O=N.enter().append("g").attr("class","nvd3 nv-wrap nv-scatter nv-chart-"+f+(B?" nv-single-point":"")),P=O.append("defs"),Q=O.append("g"),R=N.select("g");Q.append("g").attr("class","nv-groups"),Q.append("g").attr("class","nv-point-paths"),N.attr("transform","translate("+b.left+","+b.top+")"),P.append("clipPath").attr("id","nv-edge-clip-"+f).append("rect"),N.select("#nv-edge-clip-"+f+" rect").attr("width",J).attr("height",K),R.attr("clip-path",u?"url(#nv-edge-clip-"+f+")":""),I=!0;var T=N.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a){return a.key});T.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),d3.transition(T.exit()).style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),T.attr("class",function(a,b){return"nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}),d3.transition(T).style("fill",function(a,b){return e(a,b)}).style("stroke",function(a,b){return e(a,b)}).style("stroke-opacity",1).style("fill-opacity",.5);if(n){var U=T.selectAll("circle.nv-point").data(function(a){return a.values});U.enter().append("circle").attr("cx",function(a,b){return E(j(a,b))}).attr("cy",function(a,b){return F(k(a,b))}).attr("r",function(a,b){return Math.sqrt(i(l(a,b))/Math.PI)}),U.exit().remove(),d3.transition(T.exit().selectAll("path.nv-point")).attr("cx",function(a,b){return g(j(a,b))}).attr("cy",function(a,b){return h(k(a,b))}).remove(),U.attr("class",function(a,b){return"nv-point nv-point-"+b}),d3.transition(U).attr("cx",function(a,b){return g(j(a,b))}).attr("cy",function(a,b){return h(k(a,b))}).attr("r",function(a,b){return Math.sqrt(i(l(a,b))/Math.PI)})}else{var U=T.selectAll("path.nv-point").data(function(a){return a.values});U.enter().append("path").attr("transform",function(a,b){return"translate("+E(j(a,b))+","+F(k(a,b))+")"}).attr("d",d3.svg.symbol().type(m).size(function(a,b){return i(l(a,b))})),U.exit().remove(),d3.transition(T.exit().selectAll("path.nv-point")).attr("transform",function(a,b){return"translate("+g(j(a,b))+","+h(k(a,b))+")"}).remove(),U.attr("class",function(a,b){return"nv-point nv-point-"+b}),d3.transition(U).attr("transform",function(a,b){return"translate("+g(j(a,b))+","+h(k(a,b))+")"}).attr("d",d3.svg.symbol().type(m).size(function(a,b){return i(l(a,b))}))}clearTimeout(H),H=setTimeout(S,300),E=g.copy(),F=h.copy(),G=i.copy()});return J}var b={top:0,right:0,bottom:0,left:0},c=960,d=500,e=a.utils.defaultColor(),f=Math.floor(Math.random()*1e5),g=d3.scale.linear(),h=d3.scale.linear(),i=d3.scale.linear(),j=function(a){return a.x},k=function(a){return a.y},l=function(a){return a.size||1},m=function(a){return a.shape||"circle"},n=!0,o=[],p=[],q=[],r=!0,s=function(a){return!a.notActive},t=!1,u=!1,v=!0,w=function(){return 25},x=null,y=null,z=null,A=null,B=!1,C=d3.dispatch("elementClick","elementMouseover","elementMouseout"),D=!0,E,F,G,H,I=!1;C.on("elementMouseover.point",function(a){r&&d3.select(".nv-chart-"+f+" .nv-series-"+a.seriesIndex+" .nv-point-"+a.pointIndex).classed("hover",!0)}),C.on("elementMouseout.point",function(a){r&&d3.select(".nv-chart-"+f+" .nv-series-"+a.seriesIndex+" .nv-point-"+a.pointIndex).classed("hover",!1)}),J.dispatch=C,J.x=function(a){if(!arguments.length)return j;j=d3.functor(a);return J},J.y=function(a){if(!arguments.length)return k;k=d3.functor(a);return J},J.size=function(a){if(!arguments.length)return l;l=d3.functor(a);return J},J.margin=function(a){if(!arguments.length)return b;b.top=typeof a.top!="undefined"?a.top:b.top,b.right=typeof a.right!="undefined"?a.right:b.right,b.bottom=typeof a.bottom!="undefined"?a.bottom:b.bottom,b.left=typeof a.left!="undefined"?a.left:b.left;return J},J.width=function(a){if(!arguments.length)return c;c=a;return J},J.height=function(a){if(!arguments.length)return d;d=a;return J},J.xScale=function(a){if(!arguments.length)return g;g=a;return J},J.yScale=function(a){if(!arguments.length)return h;h=a;return J},J.zScale=function(a){if(!arguments.length)return i;i=a;return J},J.xDomain=function(a){if(!arguments.length)return x;x=a;return J},J.yDomain=function(a){if(!arguments.length)return y;y=a;return J},J.sizeDomain=function(a){if(!arguments.length)return z;z=a;return J},J.sizeRange=function(a){if(!arguments.length)return A;A=a;return J},J.forceX=function(a){if(!arguments.length)return o;o=a;return J},J.forceY=function(a){if(!arguments.length)return p;p=a;return J},J.forceSize=function(a){if(!arguments.length)return q;q=a;return J},J.interactive=function(a){if(!arguments.length)return r;r=a;return J},J.pointActive=function(a){if(!arguments.length)return s;s=a;return J},J.padData=function(a){if(!arguments.length)return t;t=a;return J},J.clipEdge=function(a){if(!arguments.length)return u;u=a;return J},J.clipVoronoi=function(a){if(!arguments.length)return v;v=a;return J},J.useVoronoi=function(a){if(!arguments.length)return D;D=a,D===!1&&(v=!1);return J},J.clipRadius=function(a){if(!arguments.length)return w;w=a;return J},J.color=function(b){if(!arguments.length)return e;e=a.utils.getColor(b);return J},J.shape=function(a){if(!arguments.length)return m;m=a;return J},J.onlyCircles=function(a){if(!arguments.length)return n;n=a;return J},J.id=function(a){if(!arguments.length)return f;f=a;return J},J.singlePoint=function(a){if(!arguments.length)return B;B=a;return J};return J},a.models.scatterChart=function(){function H(a){a.each(function(x){function R(){if(v){O.select(".nv-point-paths").style("pointer-events","all");return!1}O.select(".nv-point-paths").style("pointer-events","none");var a=d3.mouse(this);m.distortion(u).focus(a[0]),n.distortion(u).focus(a[1]),O.select(".nv-scatterWrap").call(b),O.select(".nv-x.nv-axis").call(c),O.select(".nv-y.nv-axis").call(d),O.select(".nv-distributionX").datum(x.filter(function(a){return!a.disabled})).call(g),O.select(".nv-distributionY").datum(x.filter(function(a){return!a.disabled})).call(h)}var y=d3.select(this),z=this,I=(j||parseInt(y.style("width"))||960)-i.left-i.right,J=(k||parseInt(y.style("height"))||400)-i.top-i.bottom;H.update=function(){H(a)},H.container=this;if(!x||!x.length||!x.filter(function(a){return a.values.length}).length){var K=y.selectAll(".nv-noData").data([B]);K.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),K.attr("x",i.left+I/2).attr("y",i.top+J/2).text(function(a){return a});return H}y.selectAll(".nv-noData").remove(),D=D||m,E=E||n;var L=y.selectAll("g.nv-wrap.nv-scatterChart").data([x]),M=L.enter().append("g").attr("class","nvd3 nv-wrap nv-scatterChart nv-chart-"+b.id()),N=M.append("g"),O=L.select("g");N.append("rect").attr("class","nvd3 nv-background"),N.append("g").attr("class","nv-x nv-axis"),N.append("g").attr("class","nv-y nv-axis"),N.append("g").attr("class","nv-scatterWrap"),N.append("g").attr("class","nv-distWrap"),N.append("g").attr("class","nv-legendWrap"),N.append("g").attr("class","nv-controlsWrap"),s&&(e.width(I/2),L.select(".nv-legendWrap").datum(x).call(e),i.top!=e.height()&&(i.top=e.height(),J=(k||parseInt(y.style("height"))||400)-i.top-i.bottom),L.select(".nv-legendWrap").attr("transform","translate("+I/2+","+ -i.top+")")),t&&(f.width(180).color(["#444"]),O.select(".nv-controlsWrap").datum(G).attr("transform","translate(0,"+ -i.top+")").call(f)),L.attr("transform","translate("+i.left+","+i.top+")"),b.width(I).height(J).color(x.map(function(a,b){return a.color||l(a,b)}).filter(function(a,b){return!x[b].disabled})),L.select(".nv-scatterWrap").datum(x.filter(function(a){return!a.disabled})).call(b);if(o){var P=m.domain()[1]-m.domain()[0];m.domain([m.domain()[0]-o*P,m.domain()[1]+o*P])}if(p){var Q=n.domain()[1]-n.domain()[0];n.domain([n.domain()[0]-p*Q,n.domain()[1]+p*Q])}c.scale(m).ticks(c.ticks()&&c.ticks().length?c.ticks():I/100).tickSize(-J,0),O.select(".nv-x.nv-axis").attr("transform","translate(0,"+n.range()[0]+")").call(c),d.scale(n).ticks(d.ticks()&&d.ticks().length?d.ticks():J/36).tickSize(-I,0),O.select(".nv-y.nv-axis").call(d),q&&(g.getData(b.x()).scale(m).width(I).color(x.map(function(a,b){return a.color||l(a,b)}).filter(function(a,b){return!x[b].disabled})),N.select(".nv-distWrap").append("g").attr("class","nv-distributionX"),O.select(".nv-distributionX").attr("transform","translate(0,"+n.range()[0]+")").datum(x.filter(function(a){return!a.disabled})).call(g)),r&&(h.getData(b.y()).scale(n).width(J).color(x.map(function(a,b){return a.color||l(a,b)}).filter(function(a,b){return!x[b].disabled})),N.select(".nv-distWrap").append("g").attr("class","nv-distributionY"),O.select(".nv-distributionY").attr("transform","translate(-"+h.size()+",0)").datum(x.filter(function(a){return!a.disabled})).call(h)),d3.fisheye&&(O.select(".nv-background").attr("width",I).attr("height",J),O.select(".nv-background").on("mousemove",R),O.select(".nv-background").on("click",function(){v=!v}),b.dispatch.on("elementClick.freezeFisheye",function(){v=!v})),f.dispatch.on("legendClick",function(e,f){e.disabled=!e.disabled,u=e.disabled?0:2.5,O.select(".nv-background").style("pointer-events",e.disabled?"none":"all"),O.select(".nv-point-paths").style("pointer-events",e.disabled?"all":"none"),e.disabled?(m.distortion(u).focus(0),n.distortion(u).focus(0),O.select(".nv-scatterWrap").call(b),O.select(".nv-x.nv-axis").call(c),O.select(".nv-y.nv-axis").call(d)):v=!1,H(a)}),e.dispatch.on("legendClick",function(b,c,d){b.disabled=!b.disabled,x.filter(function(a){return!a.disabled}).length||x.map(function(a){a.disabled=!1,L.selectAll(".nv-series").classed("disabled",!1);return a}),C.disabled=x.map(function(a){return!!a.disabled}),A.stateChange(C),H(a)}),b.dispatch.on("elementMouseover.tooltip",function(a){d3.select(".nv-chart-"+b.id()+" .nv-series-"+a.seriesIndex+" .nv-distx-"+a.pointIndex).attr("y1",a.pos[1]-J),d3.select(".nv-chart-"+b.id()+" .nv-series-"+a.seriesIndex+" .nv-disty-"+a.pointIndex).attr("x2",a.pos[0]+g.size()),a.pos=[a.pos[0]+i.left,a.pos[1]+i.top],A.tooltipShow(a)}),A.on("tooltipShow",function(a){w&&F(a,z.parentNode)}),A.on("changeState",function(b){typeof b.disabled!="undefined"&&(x.forEach(function(a,c){a.disabled=b.disabled[c]}),C.disabled=b.disabled),a.call(H)}),D=m.copy(),E=n.copy()});return H}var b=a.models.scatter(),c=a.models.axis(),d=a.models.axis(),e=a.models.legend(),f=a.models.legend(),g=a.models.distribution(),h=a.models.distribution(),i={top:30,right:20,bottom:50,left:75},j=null,k=null,l=a.utils.defaultColor(),m=d3.fisheye?d3.fisheye.scale(d3.scale.linear).distortion(0):b.xScale(),n=d3.fisheye?d3.fisheye.scale(d3.scale.linear).distortion(0):b.yScale(),o=0,p=0,q=!1,r=!1,s=!0,t=!!d3.fisheye,u=0,v=!1,w=!0,x=function(a,b,c){return""+b+""},y=function(a,b,c){return""+c+""},z=null,A=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),B="No Data Available.";b.xScale(m).yScale(n),c.orient("bottom").tickPadding(10),d.orient("left").tickPadding(10),g.axis("x"),h.axis("y");var C={},D,E,F=function(e,f){var g=e.pos[0]+(f.offsetLeft||0),h=e.pos[1]+(f.offsetTop||0),j=e.pos[0]+(f.offsetLeft||0),k=n.range()[0]+i.top+(f.offsetTop||0),l=m.range()[0]+i.left+(f.offsetLeft||0),o=e.pos[1]+(f.offsetTop||0),p=c.tickFormat()(b.x()(e.point,e.pointIndex)),q=d.tickFormat()(b.y()(e.point,e.pointIndex));x!=null&&a.tooltip.show([j,k],x(e.series.key,p,q,e,H),"n",1,f,"x-nvtooltip"),y!=null&&a.tooltip.show([l,o],y(e.series.key,p,q,e,H),"e",1,f,"y-nvtooltip"),z!=null&&a.tooltip.show([g,h],z(e.series.key,p,q,e,H),e.value<0?"n":"s",null,f)},G=[{key:"Magnify",disabled:!0}];b.dispatch.on("elementMouseout.tooltip",function(a){A.tooltipHide(a),d3.select(".nv-chart-"+b.id()+" .nv-series-"+a.seriesIndex+" .nv-distx-"+a.pointIndex).attr("y1",0),d3.select(".nv-chart-"+b.id()+" .nv-series-"+a.seriesIndex+" .nv-disty-"+a.pointIndex).attr("x2",h.size())}),A.on("tooltipHide",function(){w&&a.tooltip.cleanup()}),H.dispatch=A,H.scatter=b,H.legend=e,H.controls=f,H.xAxis=c,H.yAxis=d,H.distX=g,H.distY=h,d3.rebind(H,b,"id","interactive","pointActive","x","y","shape","size","xScale","yScale","zScale","xDomain","yDomain","sizeDomain","sizeRange","forceX","forceY","forceSize","clipVoronoi","clipRadius","useVoronoi"),H.margin=function(a){if(!arguments.length)return i;i.top=typeof a.top!="undefined"?a.top:i.top,i.right=typeof a.right!="undefined"?a.right:i.right,i.bottom=typeof a.bottom!="undefined"?a.bottom:i.bottom,i.left=typeof a.left!="undefined"?a.left:i.left;return H},H.width=function(a){if(!arguments.length)return j;j=a;return H},H.height=function(a){if(!arguments.length)return k;k=a;return H},H.color=function(b){if(!arguments.length)return l;l=a.utils.getColor(b),e.color(l),g.color(l),h.color(l);return H},H.showDistX=function(a){if(!arguments.length)return q;q=a;return H},H.showDistY=function(a){if(!arguments.length)return r;r=a;return H},H.showControls=function(a){if(!arguments.length)return t;t=a;return H},H.showLegend=function(a){if(!arguments.length)return s;s=a;return H},H.fisheye=function(a){if(!arguments.length)return u;u=a;return H},H.xPadding=function(a){if(!arguments.length)return o;o=a;return H},H.yPadding=function(a){if(!arguments.length)return p;p=a;return H},H.tooltips=function(a){if(!arguments.length)return w;w=a;return H},H.tooltipContent=function(a){if(!arguments.length)return z;z=a;return H},H.tooltipXContent=function(a){if(!arguments.length)return x;x=a;return H},H.tooltipYContent=function(a){if(!arguments.length)return y;y=a;return H},H.state=function(a){if(!arguments.length)return C;C=a;return H},H.noData=function(a){if(!arguments.length)return B;B=a;return H};return H},a.models.scatterPlusLineChart=function(){function F(a){a.each(function(v){function P(){if(t){M.select(".nv-point-paths").style("pointer-events","all");return!1}M.select(".nv-point-paths").style("pointer-events","none");var a=d3.mouse(this);m.distortion(s).focus(a[0]),n.distortion(s).focus(a[1]),M.select(".nv-scatterWrap").datum(v.filter(function(a){return!a.disabled})).call(b),M.select(".nv-x.nv-axis").call(c),M.select(".nv-y.nv-axis").call(d),M.select(".nv-distributionX").datum(v.filter(function(a){return!a.disabled})).call(g),M.select(".nv-distributionY").datum(v.filter(function(a){return!a.disabled})).call(h)}var w=d3.select(this),x=this,G=(j||parseInt(w.style("width"))||960)-i.left-i.right,H=(k||parseInt(w.style("height"))||400)-i.top-i.bottom;F.update=function(){F(a)},F.container=this;if(!v||!v.length||!v.filter(function(a){return a.values.length}).length){var I=w.selectAll(".nv-noData").data([z]);I.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),I.attr("x",i.left+G/2).attr("y",i.top+H/2).text(function(a){return a});return F}w.selectAll(".nv-noData").remove(),m=b.xScale(),n=b.yScale(),B=B||m,C=C||n;var J=w.selectAll("g.nv-wrap.nv-scatterChart").data([v]),K=J.enter().append("g").attr("class","nvd3 nv-wrap nv-scatterChart nv-chart-"+b.id()),L=K.append("g"),M=J.select("g");L.append("rect").attr("class","nvd3 nv-background"),L.append("g").attr("class","nv-x nv-axis"),L.append("g").attr("class","nv-y nv-axis"),L.append("g").attr("class","nv-scatterWrap"),L.append("g").attr("class","nv-regressionLinesWrap"),L.append("g").attr("class","nv-distWrap"),L.append("g").attr("class","nv-legendWrap"),L.append("g").attr("class","nv-controlsWrap"),J.attr("transform","translate("+i.left+","+i.top+")"),q&&(e.width(G/2),J.select(".nv-legendWrap").datum(v).call(e),i.top!=e.height()&&(i.top=e.height(),H=(k||parseInt(w.style("height"))||400)-i.top-i.bottom),J.select(".nv-legendWrap").attr("transform","translate("+G/2+","+ -i.top+")")),r&&(f.width(180).color(["#444"]),M.select(".nv-controlsWrap").datum(E).attr("transform","translate(0,"+ -i.top+")").call(f)),b.width(G).height(H).color(v.map(function(a,b){return a.color||l(a,b)}).filter(function(a,b){return!v[b].disabled})),J.select(".nv-scatterWrap").datum(v.filter(function(a){return!a.disabled})).call(b),J.select(".nv-regressionLinesWrap").attr("clip-path","url(#nv-edge-clip-"+b.id()+")");var N=J.select(".nv-regressionLinesWrap").selectAll(".nv-regLines").data(function(a){return a}),O=N.enter().append("g").attr("class","nv-regLines").append("line").attr("class","nv-regLine").style("stroke-opacity",0);N.selectAll(".nv-regLines line").attr("x1",m.range()[0]).attr("x2",m.range()[1]).attr("y1",function(a,b){return n(m.domain()[0]*a.slope+a.intercept)}).attr("y2",function(a,b){return n(m.domain()[1]*a.slope+a.intercept)}).style("stroke",function(a,b,c){return l(a,c)}).style("stroke-opacity",function(a,b){return a.disabled||typeof a.slope=="undefined"||typeof a.intercept=="undefined"?0:1}),c.scale(m).ticks(c.ticks()?c.ticks():G/100).tickSize(-H,0),M.select(".nv-x.nv-axis").attr("transform","translate(0,"+n.range()[0]+")").call(c),d.scale(n).ticks -(d.ticks()?d.ticks():H/36).tickSize(-G,0),M.select(".nv-y.nv-axis").call(d),o&&(g.getData(b.x()).scale(m).width(G).color(v.map(function(a,b){return a.color||l(a,b)}).filter(function(a,b){return!v[b].disabled})),L.select(".nv-distWrap").append("g").attr("class","nv-distributionX"),M.select(".nv-distributionX").attr("transform","translate(0,"+n.range()[0]+")").datum(v.filter(function(a){return!a.disabled})).call(g)),p&&(h.getData(b.y()).scale(n).width(H).color(v.map(function(a,b){return a.color||l(a,b)}).filter(function(a,b){return!v[b].disabled})),L.select(".nv-distWrap").append("g").attr("class","nv-distributionY"),M.select(".nv-distributionY").attr("transform","translate(-"+h.size()+",0)").datum(v.filter(function(a){return!a.disabled})).call(h)),d3.fisheye&&(M.select(".nv-background").attr("width",G).attr("height",H),M.select(".nv-background").on("mousemove",P),M.select(".nv-background").on("click",function(){t=!t}),b.dispatch.on("elementClick.freezeFisheye",function(){t=!t})),f.dispatch.on("legendClick",function(e,f){e.disabled=!e.disabled,s=e.disabled?0:2.5,M.select(".nv-background").style("pointer-events",e.disabled?"none":"all"),M.select(".nv-point-paths").style("pointer-events",e.disabled?"all":"none"),e.disabled?(m.distortion(s).focus(0),n.distortion(s).focus(0),M.select(".nv-scatterWrap").call(b),M.select(".nv-x.nv-axis").call(c),M.select(".nv-y.nv-axis").call(d)):t=!1,F(a)}),e.dispatch.on("legendClick",function(b,c,d){b.disabled=!b.disabled,v.filter(function(a){return!a.disabled}).length||v.map(function(a){a.disabled=!1,J.selectAll(".nv-series").classed("disabled",!1);return a}),A.disabled=v.map(function(a){return!!a.disabled}),y.stateChange(A),F(a)}),b.dispatch.on("elementMouseover.tooltip",function(a){d3.select(".nv-chart-"+b.id()+" .nv-series-"+a.seriesIndex+" .nv-distx-"+a.pointIndex).attr("y1",a.pos[1]-H),d3.select(".nv-chart-"+b.id()+" .nv-series-"+a.seriesIndex+" .nv-disty-"+a.pointIndex).attr("x2",a.pos[0]+g.size()),a.pos=[a.pos[0]+i.left,a.pos[1]+i.top],y.tooltipShow(a)}),y.on("tooltipShow",function(a){u&&D(a,x.parentNode)}),y.on("changeState",function(b){typeof b.disabled!="undefined"&&(v.forEach(function(a,c){a.disabled=b.disabled[c]}),A.disabled=b.disabled),a.call(F)}),B=m.copy(),C=n.copy()});return F}var b=a.models.scatter(),c=a.models.axis(),d=a.models.axis(),e=a.models.legend(),f=a.models.legend(),g=a.models.distribution(),h=a.models.distribution(),i={top:30,right:20,bottom:50,left:75},j=null,k=null,l=a.utils.defaultColor(),m=d3.fisheye?d3.fisheye.scale(d3.scale.linear).distortion(0):b.xScale(),n=d3.fisheye?d3.fisheye.scale(d3.scale.linear).distortion(0):b.yScale(),o=!1,p=!1,q=!0,r=!!d3.fisheye,s=0,t=!1,u=!0,v=function(a,b,c){return""+b+""},w=function(a,b,c){return""+c+""},x=function(a,b,c,d){return"

"+a+"

"+"

"+d+"

"},y=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),z="No Data Available.";b.xScale(m).yScale(n),c.orient("bottom").tickPadding(10),d.orient("left").tickPadding(10),g.axis("x"),h.axis("y");var A={},B,C,D=function(e,f){var g=e.pos[0]+(f.offsetLeft||0),h=e.pos[1]+(f.offsetTop||0),j=e.pos[0]+(f.offsetLeft||0),k=n.range()[0]+i.top+(f.offsetTop||0),l=m.range()[0]+i.left+(f.offsetLeft||0),o=e.pos[1]+(f.offsetTop||0),p=c.tickFormat()(b.x()(e.point,e.pointIndex)),q=d.tickFormat()(b.y()(e.point,e.pointIndex));v!=null&&a.tooltip.show([j,k],v(e.series.key,p,q,e,F),"n",1,f,"x-nvtooltip"),w!=null&&a.tooltip.show([l,o],w(e.series.key,p,q,e,F),"e",1,f,"y-nvtooltip"),x!=null&&a.tooltip.show([g,h],x(e.series.key,p,q,e.point.tooltip,e,F),e.value<0?"n":"s",null,f)},E=[{key:"Magnify",disabled:!0}];b.dispatch.on("elementMouseout.tooltip",function(a){y.tooltipHide(a),d3.select(".nv-chart-"+b.id()+" .nv-series-"+a.seriesIndex+" .nv-distx-"+a.pointIndex).attr("y1",0),d3.select(".nv-chart-"+b.id()+" .nv-series-"+a.seriesIndex+" .nv-disty-"+a.pointIndex).attr("x2",h.size())}),y.on("tooltipHide",function(){u&&a.tooltip.cleanup()}),F.dispatch=y,F.scatter=b,F.legend=e,F.controls=f,F.xAxis=c,F.yAxis=d,F.distX=g,F.distY=h,d3.rebind(F,b,"id","interactive","pointActive","x","y","shape","size","xScale","yScale","zScale","xDomain","yDomain","sizeDomain","sizeRange","forceX","forceY","forceSize","clipVoronoi","clipRadius","useVoronoi"),F.margin=function(a){if(!arguments.length)return i;i.top=typeof a.top!="undefined"?a.top:i.top,i.right=typeof a.right!="undefined"?a.right:i.right,i.bottom=typeof a.bottom!="undefined"?a.bottom:i.bottom,i.left=typeof a.left!="undefined"?a.left:i.left;return F},F.width=function(a){if(!arguments.length)return j;j=a;return F},F.height=function(a){if(!arguments.length)return k;k=a;return F},F.color=function(b){if(!arguments.length)return l;l=a.utils.getColor(b),e.color(l),g.color(l),h.color(l);return F},F.showDistX=function(a){if(!arguments.length)return o;o=a;return F},F.showDistY=function(a){if(!arguments.length)return p;p=a;return F},F.showControls=function(a){if(!arguments.length)return r;r=a;return F},F.showLegend=function(a){if(!arguments.length)return q;q=a;return F},F.fisheye=function(a){if(!arguments.length)return s;s=a;return F},F.tooltips=function(a){if(!arguments.length)return u;u=a;return F},F.tooltipContent=function(a){if(!arguments.length)return x;x=a;return F},F.tooltipXContent=function(a){if(!arguments.length)return v;v=a;return F},F.tooltipYContent=function(a){if(!arguments.length)return w;w=a;return F},F.state=function(a){if(!arguments.length)return A;A=a;return F},F.noData=function(a){if(!arguments.length)return z;z=a;return F};return F},a.models.sparkline=function(){function m(a){a.each(function(a){var e=c-b.left-b.right,m=d-b.top-b.bottom,n=d3.select(this);f.domain(k||d3.extent(a,h)).range([0,e]),g.domain(l||d3.extent(a,i)).range([m,0]);var o=n.selectAll("g.nv-wrap.nv-sparkline").data([a]),p=o.enter().append("g").attr("class","nvd3 nv-wrap nv-sparkline"),q=p.append("g"),r=o.select("g");o.attr("transform","translate("+b.left+","+b.top+")");var s=o.selectAll("path").data(function(a){return[a]});s.enter().append("path"),s.exit().remove(),s.style("stroke",function(a,b){return a.color||j(a,b)}).attr("d",d3.svg.line().x(function(a,b){return f(h(a,b))}).y(function(a,b){return g(i(a,b))}));var t=o.selectAll("circle.nv-point").data(function(a){function c(b){if(b!=-1){var c=a[b];c.pointIndex=b;return c}return null}var b=a.map(function(a,b){return i(a,b)}),d=c(b.lastIndexOf(g.domain()[1])),e=c(b.indexOf(g.domain()[0])),f=c(b.length-1);return[e,d,f].filter(function(a){return a!=null})});t.enter().append("circle"),t.exit().remove(),t.attr("cx",function(a,b){return f(h(a,a.pointIndex))}).attr("cy",function(a,b){return g(i(a,a.pointIndex))}).attr("r",2).attr("class",function(a,b){return h(a,a.pointIndex)==f.domain()[1]?"nv-point nv-currentValue":i(a,a.pointIndex)==g.domain()[0]?"nv-point nv-minValue":"nv-point nv-maxValue"})});return m}var b={top:2,right:0,bottom:2,left:0},c=400,d=32,e=!0,f=d3.scale.linear(),g=d3.scale.linear(),h=function(a){return a.x},i=function(a){return a.y},j=a.utils.getColor(["#000"]),k,l;m.margin=function(a){if(!arguments.length)return b;b.top=typeof a.top!="undefined"?a.top:b.top,b.right=typeof a.right!="undefined"?a.right:b.right,b.bottom=typeof a.bottom!="undefined"?a.bottom:b.bottom,b.left=typeof a.left!="undefined"?a.left:b.left;return m},m.width=function(a){if(!arguments.length)return c;c=a;return m},m.height=function(a){if(!arguments.length)return d;d=a;return m},m.x=function(a){if(!arguments.length)return h;h=d3.functor(a);return m},m.y=function(a){if(!arguments.length)return i;i=d3.functor(a);return m},m.xScale=function(a){if(!arguments.length)return f;f=a;return m},m.yScale=function(a){if(!arguments.length)return g;g=a;return m},m.xDomain=function(a){if(!arguments.length)return k;k=a;return m},m.yDomain=function(a){if(!arguments.length)return l;l=a;return m},m.animate=function(a){if(!arguments.length)return e;e=a;return m},m.color=function(b){if(!arguments.length)return j;j=a.utils.getColor(b);return m};return m},a.models.sparklinePlus=function(){function p(a){a.each(function(l){function F(){function d(a,c){var d=Math.abs(b.x()(a[0],0)-c),e=0;for(var f=0;f"+a+""+"

"+c+" on "+b+"

"},o,p,q=d3.format(",.2f"),r={style:b.style()},s="No Data Available.",t=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),u=250;c.orient("bottom").tickPadding(7),d.orient("left"),b.scatter.pointActive(function(a){return!!Math.round(b.y()(a)*100)});var v=function(e,f){var g=e.pos[0]+(f.offsetLeft||0),h=e.pos[1]+(f.offsetTop||0),i=c.tickFormat()(b.x()(e.point,e.pointIndex)),j=d.tickFormat()(b.y()(e.point,e.pointIndex)),k=n(e.series.key,i,j,e,w);a.tooltip.show([g,h],k,e.value<0?"n":"s",null,f)};b.dispatch.on("tooltipShow",function(a){a.pos=[a.pos[0]+g.left,a.pos[1]+g.top],t.tooltipShow(a)}),b.dispatch.on("tooltipHide",function(a){t.tooltipHide(a)}),t.on("tooltipHide",function(){m&&a.tooltip.cleanup()}),w.dispatch=t,w.stacked=b,w.legend=e,w.controls=f,w.xAxis=c,w.yAxis=d,d3.rebind(w,b,"x","y","size","xScale","yScale","xDomain","yDomain","sizeDomain","interactive","offset","order","style","clipEdge","forceX","forceY","forceSize","interpolate"),w.margin=function(a){if(!arguments.length)return g;g.top=typeof a.top!="undefined"?a.top:g.top,g.right=typeof a.right!="undefined"?a.right:g.right,g.bottom=typeof a.bottom!="undefined"?a.bottom:g.bottom,g.left=typeof a.left!="undefined"?a.left:g.left;return w},w.width=function(a){if(!arguments.length)return getWidth;h=a;return w},w.height=function(a){if(!arguments.length)return getHeight;i=a;return w},w.color=function(c){if(!arguments.length)return j;j=a.utils.getColor(c),e.color(j),b.color(j);return w},w.showControls=function(a){if(!arguments.length)return k;k=a;return w},w.showLegend=function(a){if(!arguments.length)return l;l=a;return w},w.tooltip=function(a){if(!arguments.length)return n;n=a;return w},w.tooltips=function(a){if(!arguments.length)return m;m=a;return w},w.tooltipContent=function(a){if(!arguments.length)return n;n=a;return w},w.state=function(a){if(!arguments.length)return r;r=a;return w},w.noData=function(a){if(!arguments.length)return s;s=a;return w},d.setTickFormat=d.tickFormat,d.tickFormat=function(a){if(!arguments.length)return q;q=a;return d};return w}})() \ No newline at end of file +,c,A);a.tooltip.show([g,h],k,null,null,f)};b.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+j.left,a.pos[1]+j.top],y.tooltipShow(a)}),b.dispatch.on("elementMouseout.tooltip",function(a){y.tooltipHide(a)}),y.on("tooltipHide",function(){v&&a.tooltip.cleanup()}),A.dispatch=y,A.legend=h,A.lines=b,A.lines2=c,A.xAxis=d,A.yAxis=e,A.x2Axis=f,A.y2Axis=g,d3.rebind(A,b,"defined","isArea","size","xDomain","yDomain","forceX","forceY","interactive","clipEdge","clipVoronoi","id"),A.x=function(a){if(!arguments.length)return b.x;b.x(a),c.x(a);return A},A.y=function(a){if(!arguments.length)return b.y;b.y(a),c.y(a);return A},A.margin=function(a){if(!arguments.length)return j;j.top=typeof a.top!="undefined"?a.top:j.top,j.right=typeof a.right!="undefined"?a.right:j.right,j.bottom=typeof a.bottom!="undefined"?a.bottom:j.bottom,j.left=typeof a.left!="undefined"?a.left:j.left;return A},A.margin2=function(a){if(!arguments.length)return k;k=a;return A},A.width=function(a){if(!arguments.length)return m;m=a;return A},A.height=function(a){if(!arguments.length)return n;n=a;return A},A.height2=function(a){if(!arguments.length)return o;o=a;return A},A.color=function(b){if(!arguments.length)return l;l=a.utils.getColor(b),h.color(l);return A},A.showLegend=function(a){if(!arguments.length)return t;t=a;return A},A.tooltips=function(a){if(!arguments.length)return v;v=a;return A},A.tooltipContent=function(a){if(!arguments.length)return w;w=a;return A},A.interpolate=function(a){if(!arguments.length)return b.interpolate();b.interpolate(a),c.interpolate(a);return A},A.noData=function(a){if(!arguments.length)return x;x=a;return A},A.xTickFormat=function(a){if(!arguments.length)return d.tickFormat();d.tickFormat(a),f.tickFormat(a);return A},A.yTickFormat=function(a){if(!arguments.length)return e.tickFormat();e.tickFormat(a),g.tickFormat(a);return A};return A},a.models.multiBar=function(){function v(a){a.each(function(a){var v=c-b.left-b.right,w=d-b.top-b.bottom,z=d3.select(this);l&&(a=d3.layout.stack().offset("zero").values(function(a){return a.values}).y(i)(a)),a=a.map(function(a,b){a.values=a.values.map(function(a){a.series=b;return a});return a}),l&&a[0].values.map(function(b,c){var d=0,e=0;a.map(function(a){var b=a.values[c];b.size=Math.abs(b.y),b.y<0?(b.y1=e,e=e-b.size):(b.y1=b.size+d,d=d+b.size)})});var A=q&&r?[]:a.map(function(a){return a.values.map(function(a,b){return{x:h(a,b),y:i(a,b),y0:a.y0,y1:a.y1}})});e.domain(d3.merge(A).map(function(a){return a.x})).rangeBands([0,v],.1),f.domain(r||d3.extent(d3.merge(A).map(function(a){return a.y+(l?a.y1:0)}).concat(j))).range([w,0]);if(e.domain()[0]===e.domain()[1]||f.domain()[0]===f.domain()[1])singlePoint=!0;e.domain()[0]===e.domain()[1]&&(e.domain()[0]?e.domain([e.domain()[0]-e.domain()[0]*.01,e.domain()[1]+e.domain()[1]*.01]):e.domain([-1,1])),f.domain()[0]===f.domain()[1]&&(f.domain()[0]?f.domain([f.domain()[0]+f.domain()[0]*.01,f.domain()[1]-f.domain()[1]*.01]):f.domain([-1,1])),t=t||e,u=u||f;var B=z.selectAll("g.nv-wrap.nv-multibar").data([a]),C=B.enter().append("g").attr("class","nvd3 nv-wrap nv-multibar"),D=C.append("defs"),E=C.append("g"),F=B.select("g");E.append("g").attr("class","nv-groups"),B.attr("transform","translate("+b.left+","+b.top+")"),D.append("clipPath").attr("id","nv-edge-clip-"+g).append("rect"),B.select("#nv-edge-clip-"+g+" rect").attr("width",v).attr("height",w),F.attr("clip-path",k?"url(#nv-edge-clip-"+g+")":"");var G=B.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a){return a.key});G.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),d3.transition(G.exit()).selectAll("rect.nv-bar").delay(function(b,c){return c*p/a[0].values.length}).attr("y",function(a){return l?u(a.y0):u(0)}).attr("height",0).remove(),G.attr("class",function(a,b){return"nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}).style("fill",function(a,b){return m(a,b)}).style("stroke",function(a,b){return m(a,b)}),d3.transition(G).style("stroke-opacity",1).style("fill-opacity",.75);var H=G.selectAll("rect.nv-bar").data(function(a){return a.values});H.exit().remove();var I=H.enter().append("rect").attr("class",function(a,b){return i(a,b)<0?"nv-bar negative":"nv-bar positive"}).attr("x",function(b,c,d){return l?0:d*e.rangeBand()/a.length}).attr("y",function(a){return u(l?a.y0:0)}).attr("height",0).attr("width",e.rangeBand()/(l?1:a.length));H.style("fill",function(a,b,c){return m(a,c,b)}).style("stroke",function(a,b,c){return m(a,c,b)}).on("mouseover",function(b,c){d3.select(this).classed("hover",!0),s.elementMouseover({value:i(b,c),point:b,series:a[b.series],pos:[e(h(b,c))+e.rangeBand()*(l?a.length/2:b.series+.5)/a.length,f(i(b,c)+(l?b.y0:0))],pointIndex:c,seriesIndex:b.series,e:d3.event})}).on("mouseout",function(b,c){d3.select(this).classed("hover",!1),s.elementMouseout({value:i(b,c),point:b,series:a[b.series],pointIndex:c,seriesIndex:b.series,e:d3.event})}).on("click",function(b,c){s.elementClick({value:i(b,c),point:b,series:a[b.series],pos:[e(h(b,c))+e.rangeBand()*(l?a.length/2:b.series+.5)/a.length,f(i(b,c)+(l?b.y0:0))],pointIndex:c,seriesIndex:b.series,e:d3.event}),d3.event.stopPropagation()}).on("dblclick",function(b,c){s.elementDblClick({value:i(b,c),point:b,series:a[b.series],pos:[e(h(b,c))+e.rangeBand()*(l?a.length/2:b.series+.5)/a.length,f(i(b,c)+(l?b.y0:0))],pointIndex:c,seriesIndex:b.series,e:d3.event}),d3.event.stopPropagation()}),H.attr("class",function(a,b){return i(a,b)<0?"nv-bar negative":"nv-bar positive"}).attr("transform",function(a,b){return"translate("+e(h(a,b))+",0)"}),n&&(o||(o=a.map(function(){return!0})),H.style("fill",function(a,b,c){return d3.rgb(n(a,b)).darker(o.map(function(a,b){return b}).filter(function(a,b){return!o[b]})[c]).toString()}).style("stroke",function(a,b,c){return d3.rgb(n(a,b)).darker(o.map(function(a,b){return b}).filter(function(a,b){return!o[b]})[c]).toString()})),l?d3.transition(H).delay(function(b,c){return c*p/a[0].values.length}).attr("y",function(a,b){return f(l?a.y1:0)}).attr("height",function(a,b){return Math.max(Math.abs(f(a.y+(l?a.y0:0))-f(l?a.y0:0)),1)}).each("end",function(){d3.transition(d3.select(this)).attr("x",function(b,c){return l?0:b.series*e.rangeBand()/a.length}).attr("width",e.rangeBand()/(l?1:a.length))}):d3.transition(H).delay(function(b,c){return c*p/a[0].values.length}).attr("x",function(b,c){return b.series*e.rangeBand()/a.length}).attr("width",e.rangeBand()/a.length).each("end",function(){d3.transition(d3.select(this)).attr("y",function(a,b){return i(a,b)<0?f(0):f(0)-f(i(a,b))<1?f(0)-1:f(i(a,b))}).attr("height",function(a,b){return Math.max(Math.abs(f(i(a,b))-f(0)),1)})}),t=e.copy(),u=f.copy()});return v}var b={top:0,right:0,bottom:0,left:0},c=960,d=500,e=d3.scale.ordinal(),f=d3.scale.linear(),g=Math.floor(Math.random()*1e4),h=function(a){return a.x},i=function(a){return a.y},j=[0],k=!0,l=!1,m=a.utils.defaultColor(),n=null,o,p=1200,q,r,s=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout"),t,u;v.dispatch=s,v.x=function(a){if(!arguments.length)return h;h=a;return v},v.y=function(a){if(!arguments.length)return i;i=a;return v},v.margin=function(a){if(!arguments.length)return b;b.top=typeof a.top!="undefined"?a.top:b.top,b.right=typeof a.right!="undefined"?a.right:b.right,b.bottom=typeof a.bottom!="undefined"?a.bottom:b.bottom,b.left=typeof a.left!="undefined"?a.left:b.left;return v},v.width=function(a){if(!arguments.length)return c;c=a;return v},v.height=function(a){if(!arguments.length)return d;d=a;return v},v.xScale=function(a){if(!arguments.length)return e;e=a;return v},v.yScale=function(a){if(!arguments.length)return f;f=a;return v},v.xDomain=function(a){if(!arguments.length)return q;q=a;return v},v.yDomain=function(a){if(!arguments.length)return r;r=a;return v},v.forceY=function(a){if(!arguments.length)return j;j=a;return v},v.stacked=function(a){if(!arguments.length)return l;l=a;return v},v.clipEdge=function(a){if(!arguments.length)return k;k=a;return v},v.color=function(b){if(!arguments.length)return m;m=a.utils.getColor(b);return v},v.barColor=function(b){if(!arguments.length)return n;n=a.utils.getColor(b);return v},v.disabled=function(a){if(!arguments.length)return o;o=a;return v},v.id=function(a){if(!arguments.length)return g;g=a;return v},v.delay=function(a){if(!arguments.length)return p;p=a;return v};return v},a.models.multiBarChart=function(){function w(a){a.each(function(p){var z=d3.select(this),A=this,B=(h||parseInt(z.style("width"))||960)-g.left-g.right,C=(i||parseInt(z.style("height"))||400)-g.top-g.bottom;w.update=function(){a.transition().call(w)},w.container=this;if(!p||!p.length||!p.filter(function(a){return a.values.length}).length){var D=z.selectAll(".nv-noData").data([t]);D.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),D.attr("x",g.left+B/2).attr("y",g.top+C/2).text(function(a){return a});return w}z.selectAll(".nv-noData").remove(),q=b.xScale(),r=b.yScale();var E=z.selectAll("g.nv-wrap.nv-multiBarWithLegend").data([p]),F=E.enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarWithLegend").append("g"),G=E.select("g");F.append("g").attr("class","nv-x nv-axis"),F.append("g").attr("class","nv-y nv-axis"),F.append("g").attr("class","nv-barsWrap"),F.append("g").attr("class","nv-legendWrap"),F.append("g").attr("class","nv-controlsWrap"),l&&(e.width(B/2),b.barColor()&&p.forEach(function(a,b){a.color=d3.rgb("#ccc").darker(b*1.5).toString()}),G.select(".nv-legendWrap").datum(p).call(e),g.top!=e.height()&&(g.top=e.height(),C=(i||parseInt(z.style("height"))||400)-g.top-g.bottom),G.select(".nv-legendWrap").attr("transform","translate("+B/2+","+ -g.top+")"));if(k){var H=[{key:"Grouped",disabled:b.stacked()},{key:"Stacked",disabled:!b.stacked()}];f.width(180).color(["#444","#444","#444"]),G.select(".nv-controlsWrap").datum(H).attr("transform","translate(0,"+ -g.top+")").call(f)}E.attr("transform","translate("+g.left+","+g.top+")"),b.disabled(p.map(function(a){return a.disabled})).width(B).height(C).color(p.map(function(a,b){return a.color||j(a,b)}).filter(function(a,b){return!p[b].disabled}));var I=G.select(".nv-barsWrap").datum(p.filter(function(a){return!a.disabled}));d3.transition(I).call(b),c.scale(q).ticks(B/100).tickSize(-C,0),G.select(".nv-x.nv-axis").attr("transform","translate(0,"+r.range()[0]+")"),d3.transition(G.select(".nv-x.nv-axis")).call(c);var J=G.select(".nv-x.nv-axis > g").selectAll("g");J.selectAll("line, text").style("opacity",1),m&&J.filter(function(a,b){return b%Math.ceil(p[0].values.length/(B/100))!==0}).selectAll("text, line").style("opacity",0),n&&J.selectAll("text").attr("transform",function(a,b,c){return"rotate("+n+" 0,0)"}).attr("text-transform",n>0?"start":"end"),G.select(".nv-x.nv-axis").selectAll("g.nv-axisMaxMin text").style("opacity",1),d.scale(r).ticks(C/36).tickSize(-B,0),d3.transition(G.select(".nv-y.nv-axis")).call(d),e.dispatch.on("legendClick",function(b,c){b.disabled=!b.disabled,p.filter(function(a){return!a.disabled}).length||p.map(function(a){a.disabled=!1,E.selectAll(".nv-series").classed("disabled",!1);return a}),s.disabled=p.map(function(a){return!!a.disabled}),u.stateChange(s),a.transition().call(w)}),f.dispatch.on("legendClick",function(c,d){if(!!c.disabled){H=H.map(function(a){a.disabled=!0;return a}),c.disabled=!1;switch(c.key){case"Grouped":b.stacked(!1);break;case"Stacked":b.stacked(!0)}s.stacked=b.stacked(),u.stateChange(s),a.transition().call(w)}}),u.on("tooltipShow",function(a){o&&v(a,A.parentNode)}),u.on("changeState",function(c){typeof c.disabled!="undefined"&&(p.forEach(function(a,b){a.disabled=c.disabled[b]}),s.disabled=c.disabled),typeof c.stacked!="undefined"&&(b.stacked(c.stacked),s.stacked=c.stacked),a.call(w)})});return w}var b=a.models.multiBar(),c=a.models.axis(),d=a.models.axis(),e=a.models.legend(),f=a.models.legend(),g={top:30,right:20,bottom:30,left:60},h=null,i=null,j=a.utils.defaultColor(),k=!0,l=!0,m=!0,n=0,o=!0,p=function(a,b,c,d,e){return"

"+a+"

"+"

"+c+" on "+b+"

"},q,r,s={stacked:!1},t="No Data Available.",u=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState");b.stacked(!1),c.orient("bottom").tickPadding(7).highlightZero(!1).showMaxMin(!1).tickFormat(function(a){return a}),d.orient("left").tickFormat(d3.format(",.1f"));var v=function(e,f){var g=e.pos[0]+(f.offsetLeft||0),h=e.pos[1]+(f.offsetTop||0),i=c.tickFormat()(b.x()(e.point,e.pointIndex)),j=d.tickFormat()(b.y()(e.point,e.pointIndex)),k=p(e.series.key,i,j,e,w);a.tooltip.show([g,h],k,e.value<0?"n":"s",null,f)};b.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+g.left,a.pos[1]+g.top],u.tooltipShow(a)}),b.dispatch.on("elementMouseout.tooltip",function(a){u.tooltipHide(a)}),u.on("tooltipHide",function(){o&&a.tooltip.cleanup()}),w.dispatch=u,w.multibar=b,w.legend=e,w.xAxis=c,w.yAxis=d,d3.rebind(w,b,"x","y","xDomain","yDomain","forceX","forceY","clipEdge","id","stacked","delay","barColor"),w.margin=function(a){if(!arguments.length)return g;g.top=typeof a.top!="undefined"?a.top:g.top,g.right=typeof a.right!="undefined"?a.right:g.right,g.bottom=typeof a.bottom!="undefined"?a.bottom:g.bottom,g.left=typeof a.left!="undefined"?a.left:g.left;return w},w.width=function(a){if(!arguments.length)return h;h=a;return w},w.height=function(a){if(!arguments.length)return i;i=a;return w},w.color=function(b){if(!arguments.length)return j;j=a.utils.getColor(b),e.color(j);return w},w.showControls=function(a){if(!arguments.length)return k;k=a;return w},w.showLegend=function(a){if(!arguments.length)return l;l=a;return w},w.reduceXTicks=function(a){if(!arguments.length)return m;m=a;return w},w.rotateLabels=function(a){if(!arguments.length)return n;n=a;return w},w.tooltip=function(a){if(!arguments.length)return p;p=a;return w},w.tooltips=function(a){if(!arguments.length)return o;o=a;return w},w.tooltipContent=function(a){if(!arguments.length)return p;p=a;return w},w.state=function(a){if(!arguments.length)return s;s=a;return w},w.noData=function(a){if(!arguments.length)return t;t=a;return w};return w},a.models.multiBarHorizontal=function(){function x(a){a.each(function(a){var e=c-b.left-b.right,r=d-b.top-b.bottom,x=d3.select(this);n&&(a=d3.layout.stack().offset("zero").values(function(a){return a.values}).y(i)(a)),a=a.map(function(a,b){a.values=a.values.map(function(a){a.series=b;return a});return a}),n&&a[0].values.map(function(b,c){var d=0,e=0;a.map(function(a){var b=a.values[c];b.size=Math.abs(b.y),b.y<0?(b.y1=e-b.size,e=e-b.size):(b.y1=d,d=d+b.size)})});var z=s&&t?[]:a.map(function(a){return a.values.map(function(a,b){return{x:h(a,b),y:i(a,b),y0:a.y0,y1:a.y1}})});f.domain(s||d3.merge(z).map(function(a){return a.x})).rangeBands([0,r],.1),g.domain(t||d3.extent(d3.merge(z).map(function(a){return n?a.y>0?a.y1+a.y:a.y1:a.y}).concat(j))),o&&!n?g.range([g.domain()[0]<0?p:0,e-(g.domain()[1]>0?p:0)]):g.range([0,e]),v=v||f,w=w||d3.scale.linear().domain(g.domain()).range([g(0),g(0)]);var A=d3.select(this).selectAll("g.nv-wrap.nv-multibarHorizontal").data([a]),B=A.enter().append("g").attr("class","nvd3 nv-wrap nv-multibarHorizontal"),C=B.append("defs"),D=B.append("g"),E=A.select("g");D.append("g").attr("class","nv-groups"),A.attr("transform","translate("+b.left+","+b.top+")");var F=A.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a){return a.key});F.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),d3.transition(F.exit()).style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),F.attr("class",function(a,b){return"nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}).style("fill",function(a,b){return k(a,b)}).style("stroke",function(a,b){return k(a,b)}),d3.transition(F).style("stroke-opacity",1).style("fill-opacity",.75);var G=F.selectAll("g.nv-bar").data(function(a){return a.values});G.exit().remove();var H=G.enter().append("g").attr("transform",function(b,c,d){return"translate("+w(n?b.y0:0)+","+(n?0:d*f.rangeBand()/a.length+f(h(b,c)))+")"});H.append("rect").attr("width",0).attr("height",f.rangeBand()/(n?1:a.length)),G.on("mouseover",function(b,c){d3.select(this).classed("hover",!0),u.elementMouseover({value:i(b,c),point:b,series:a[b.series],pos:[g(i(b,c)+(n?b.y0:0)),f(h(b,c))+f.rangeBand()*(n?a.length/2:b.series+.5)/a.length],pointIndex:c,seriesIndex:b.series,e:d3.event})}).on("mouseout",function(b,c){d3.select(this).classed("hover",!1),u.elementMouseout({value:i(b,c),point:b,series:a[b.series],pointIndex:c,seriesIndex:b.series,e:d3.event})}).on("click",function(b,c){u.elementClick({value:i(b,c),point:b,series:a[b.series],pos:[f(h(b,c))+f.rangeBand()*(n?a.length/2:b.series+.5)/a.length,g(i(b,c)+(n?b.y0:0))],pointIndex:c,seriesIndex:b.series,e:d3.event}),d3.event.stopPropagation()}).on("dblclick",function(b,c){u.elementDblClick({value:i(b,c),point:b,series:a[b.series],pos:[f(h(b,c))+f.rangeBand()*(n?a.length/2:b.series+.5)/a.length,g(i(b,c)+(n?b.y0:0))],pointIndex:c,seriesIndex:b.series,e:d3.event}),d3.event.stopPropagation()}),H.append("text"),o&&!n?(G.select("text").attr("text-anchor",function(a,b){return i(a,b)<0?"end":"start"}).attr("y",f.rangeBand()/(a.length*2)).attr("dy",".32em").text(function(a,b){return q(i(a,b))}),d3.transition(G).select("text").attr("x",function(a,b){return i(a,b)<0?-4:g(i(a,b))-g(0)+4})):G.selectAll("text").text(""),G.attr("class",function(a,b){return i(a,b)<0?"nv-bar negative":"nv-bar positive"}),l&&(m||(m=a.map(function(){return!0})),G.style("fill",function(a,b,c){return d3.rgb(l(a,b)).darker(m.map(function(a,b){return b}).filter(function(a,b){return!m[b]})[c]).toString()}).style("stroke",function(a,b,c){return d3.rgb(l(a,b)).darker(m.map(function(a,b){return b}).filter(function(a,b){return!m[b]})[c]).toString()})),n?d3.transition(G).attr("transform",function(a,b){return"translate("+g(a.y1)+","+f(h(a,b))+")"}).select("rect").attr("width",function(a,b){return Math.abs(g(i(a,b)+a.y0)-g(a.y0))}).attr("height",f.rangeBand()):d3.transition(G).attr("transform",function(b,c){return"translate("+(i(b,c)<0?g(i(b,c)):g(0))+","+(b.series*f.rangeBand()/a.length+f(h(b,c)))+")"}).select("rect").attr("height",f.rangeBand()/a.length).attr("width",function(a,b){return Math.max(Math.abs(g(i(a,b))-g(0)),1)}),v=f.copy(),w=g.copy()});return x}var b={top:0,right:0,bottom:0,left:0},c=960,d=500,e=Math.floor(Math.random()*1e4),f=d3.scale.ordinal(),g=d3.scale.linear(),h=function(a){return a.x},i=function(a){return a.y},j=[0],k=a.utils.defaultColor(),l=null,m,n=!1,o=!1,p=60,q=d3.format(",.2f"),r=1200,s,t,u=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout"),v,w;x.dispatch=u,x.x=function(a){if(!arguments.length)return h;h=a;return x},x.y=function(a){if(!arguments.length)return i;i=a;return x},x.margin=function(a){if(!arguments.length)return b;b.top=typeof a.top!="undefined"?a.top:b.top,b.right=typeof a.right!="undefined"?a.right:b.right,b.bottom=typeof a.bottom!="undefined"?a.bottom:b.bottom,b.left=typeof a.left!="undefined"?a.left:b.left;return x},x.width=function(a){if(!arguments.length)return c;c=a;return x},x.height=function(a){if(!arguments.length)return d;d=a;return x},x.xScale=function(a){if(!arguments.length)return f;f=a;return x},x.yScale=function(a){if(!arguments.length)return g;g=a;return x},x.xDomain=function(a){if(!arguments.length)return s;s=a;return x},x.yDomain=function(a){if(!arguments.length)return t;t=a;return x},x.forceY=function(a){if(!arguments.length)return j;j=a;return x},x.stacked=function(a){if(!arguments.length)return n;n=a;return x},x.color=function(b){if(!arguments.length)return k;k=a.utils.getColor(b);return x},x.barColor=function(b){if(!arguments.length)return l;l=a.utils.getColor(b);return x},x.disabled=function(a){if(!arguments.length)return m;m=a;return x},x.id=function(a){if(!arguments.length)return e;e=a;return x},x.delay=function(a){if(!arguments.length)return r;r=a;return x},x.showValues=function(a){if(!arguments.length)return o;o=a;return x},x.valueFormat=function(a){if(!arguments.length)return q;q=a;return x},x.valuePadding=function(a){if(!arguments.length)return p;p=a;return x};return x},a.models.multiBarHorizontalChart=function(){function v(a){a.each(function(m){var o=d3.select(this),w=this,z=(h||parseInt(o.style("width"))||960)-g.left-g.right,A=(i||parseInt(o.style("height"))||400)-g.top-g.bottom;v.update=function(){a.transition().call(v)},v.container=this;if(!m||!m.length||!m.filter(function(a){return a.values.length}).length){var B=o.selectAll(".nv-noData").data([s]);B.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),B.attr("x",g.left+z/2).attr("y",g.top+A/2).text(function(a){return a});return v}o.selectAll(".nv-noData").remove(),p=b.xScale(),q=b.yScale();var C=o.selectAll("g.nv-wrap.nv-multiBarHorizontalChart").data([m]),D=C.enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarHorizontalChart").append("g"),E=C.select("g");D.append("g").attr("class","nv-x nv-axis"),D.append("g").attr("class","nv-y nv-axis"),D.append("g").attr("class","nv-barsWrap"),D.append("g").attr("class","nv-legendWrap"),D.append("g").attr("class","nv-controlsWrap"),l&&(e.width(z/2),b.barColor()&&m.forEach(function(a,b){a.color=d3.rgb("#ccc").darker(b*1.5).toString()}),E.select(".nv-legendWrap").datum(m).call(e),g.top!=e.height()&&(g.top=e.height(),A=(i||parseInt(o.style("height"))||400)-g.top-g.bottom),E.select(".nv-legendWrap").attr("transform","translate("+z/2+","+ -g.top+")"));if(k){var F=[{key:"Grouped",disabled:b.stacked()},{key:"Stacked",disabled:!b.stacked()}];f.width(180).color(["#444","#444","#444"]),E.select(".nv-controlsWrap").datum(F).attr("transform","translate(0,"+ -g.top+")").call(f)}C.attr("transform","translate("+g.left+","+g.top+")"),b.disabled(m.map(function(a){return a.disabled})).width(z).height(A).color(m.map(function(a,b){return a.color||j(a,b)}).filter(function(a,b){return!m[b].disabled}));var G=E.select(".nv-barsWrap").datum(m.filter(function(a){return!a.disabled}));d3.transition(G).call(b),c.scale(p).ticks(A/24).tickSize(-z,0),d3.transition(E.select(".nv-x.nv-axis")).call(c);var H=E.select(".nv-x.nv-axis").selectAll("g");H.selectAll("line, text").style("opacity",1),d.scale(q).ticks(z/100).tickSize(-A,0),E.select(".nv-y.nv-axis").attr("transform","translate(0,"+A+")"),d3.transition(E.select(".nv-y.nv-axis")).call(d),e.dispatch.on("legendClick",function(b,c){b.disabled=!b.disabled,m.filter(function(a){return!a.disabled}).length||m.map(function(a){a.disabled=!1,C.selectAll(".nv-series").classed("disabled",!1);return a}),r.disabled=m.map(function(a){return!!a.disabled}),t.stateChange(r),a.transition().call(v)}),f.dispatch.on("legendClick",function(c,d){if(!!c.disabled){F=F.map(function(a){a.disabled=!0;return a}),c.disabled=!1;switch(c.key){case"Grouped":b.stacked(!1);break;case"Stacked":b.stacked(!0)}r.stacked=b.stacked(),t.stateChange(r),a.transition().call(v)}}),t.on("tooltipShow",function(a){n&&u(a,w.parentNode)}),t.on("changeState",function(c){typeof c.disabled!="undefined"&&(m.forEach(function(a,b){a.disabled=c.disabled[b]}),r.disabled=c.disabled),typeof c.stacked!="undefined"&&(b.stacked(c.stacked),r.stacked=c.stacked),a.call(v)})});return v}var b=a.models.multiBarHorizontal(),c=a.models.axis(),d=a.models.axis(),e=a.models.legend().height(30),f=a.models.legend().height(30),g={top:30,right:20,bottom:50,left:60},h=null,i=null,j=a.utils.defaultColor(),k=!0,l=!0,m=!1,n=!0,o=function(a,b,c,d,e){return"

"+a+" - "+b+"

"+"

"+c+"

"},p,q,r={stacked:m},s="No Data Available.",t=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState");b.stacked(m),c.orient("left").tickPadding(5).highlightZero(!1).showMaxMin(!1).tickFormat(function(a){return a}),d.orient("bottom").tickFormat(d3.format(",.1f"));var u=function(e,f){var g=e.pos[0]+(f.offsetLeft||0),h=e.pos[1]+(f.offsetTop||0),i=c.tickFormat()(b.x()(e.point,e.pointIndex)),j=d.tickFormat()(b.y()(e.point,e.pointIndex)),k=o(e.series.key,i,j,e,v);a.tooltip.show([g,h],k,e.value<0?"e":"w",null,f)};b.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+g.left,a.pos[1]+g.top],t.tooltipShow(a)}),b.dispatch.on("elementMouseout.tooltip",function(a){t.tooltipHide(a)}),t.on("tooltipHide",function(){n&&a.tooltip.cleanup()}),v.dispatch=t,v.multibar=b,v.legend=e,v.xAxis=c,v.yAxis=d,d3.rebind(v,b,"x","y","xDomain","yDomain","forceX","forceY","clipEdge","id","delay","showValues","valueFormat","stacked","barColor"),v.margin=function(a){if(!arguments.length)return g;g.top=typeof a.top!="undefined"?a.top:g.top,g.right=typeof a.right!="undefined"?a.right:g.right,g.bottom=typeof a.bottom!="undefined"?a.bottom:g.bottom,g.left=typeof a.left!="undefined"?a.left:g.left;return v},v.width=function(a){if(!arguments.length)return h;h=a;return v},v.height=function(a){if(!arguments.length)return i;i=a;return v},v.color=function(b){if(!arguments.length)return j;j=a.utils.getColor(b),e.color(j);return v},v.showControls=function(a){if(!arguments.length)return k;k=a;return v},v.showLegend=function(a){if(!arguments.length)return l;l=a;return v},v.tooltip=function(a){if(!arguments.length)return o;o=a;return v},v.tooltips=function(a){if(!arguments.length)return n;n=a;return v},v.tooltipContent=function(a){if(!arguments.length)return o;o=a;return v},v.state=function(a){if(!arguments.length)return r;r=a;return v},v.noData=function(a){if(!arguments.length)return s;s=a;return v};return v},a.models.multiChart=function(){function y(a){a.each(function(h){var j=d3.select(this),z=this,A=(d||parseInt(j.style("width"))||960)-b.left-b.right,B=(e||parseInt(j.style("height"))||400)-b.top-b.bottom,C=h.filter(function(a){return!a.disabled&&a.type=="line"&&a.yAxis==1}),D=h.filter(function(a){return!a.disabled&&a.type=="line"&&a.yAxis==2}),E=h.filter(function(a){return!a.disabled&&a.type=="bar"&&a.yAxis==1}),F=h.filter(function(a){return!a.disabled&&a.type=="bar"&&a.yAxis==2}),G=h.filter(function(a){return!a.disabled&&a.type=="area"&&a.yAxis==1}),H=h.filter(function(a){return!a.disabled&&a.type=="area"&&a.yAxis==2}),I=h.filter(function(a){return!a.disabled&&a.yAxis==1}).map(function(a){return a.values.map(function(a,b){return{x:a.x,y:a.y}})}),J=h.filter(function(a){return!a.disabled&&a.yAxis==2}).map(function(a){return a.values.map(function(a,b){return{x:a.x,y:a.y}})});i.domain(d3.extent(d3.merge(I.concat(J)),function(a){return a.x})).range([0,A]);var K=j.selectAll("g.wrap.multiChart").data([h]),L=K.enter().append("g").attr("class","wrap nvd3 multiChart").append("g");L.append("g").attr("class","x axis"),L.append("g").attr("class","y1 axis"),L.append("g").attr("class","y2 axis"),L.append("g").attr("class","lines1Wrap"),L.append("g").attr("class","lines2Wrap"),L.append("g").attr("class","bars1Wrap"),L.append("g").attr("class","bars2Wrap"),L.append("g").attr("class","stack1Wrap"),L.append("g").attr("class","stack2Wrap"),L.append("g").attr("class","legendWrap");var M=K.select("g");f&&(v.width(A/2),M.select(".legendWrap").datum(h.map(function(a){a.originalKey=a.originalKey===undefined?a.key:a.originalKey,a.key=a.originalKey+(a.yAxis==1?"":" (right axis)");return a})).call(v),b.top!=v.height()&&(b.top=v.height(),B=(e||parseInt(j.style("height"))||400)-b.top-b.bottom),M.select(".legendWrap").attr("transform","translate("+A/2+","+ -b.top+")")),m.width(A).height(B).interpolate("monotone").color(h.map(function(a,b){return a.color||c[b%c.length]}).filter(function(a,b){return!h[b].disabled&&h[b].yAxis==1&&h[b].type=="line"})),n.width(A).height(B).interpolate("monotone").color(h.map(function(a,b){return a.color||c[b%c.length]}).filter(function(a,b){return!h[b].disabled&&h[b].yAxis==2&&h[b].type=="line"})),o.width(A).height(B).color(h.map(function(a,b){return a.color||c[b%c.length]}).filter(function(a,b){return!h[b].disabled&&h[b].yAxis==1&&h[b].type=="bar"})),p.width(A).height(B).color(h.map(function(a,b){return a.color||c[b%c.length]}).filter(function(a,b){return!h[b].disabled&&h[b].yAxis==2&&h[b].type=="bar"})),q.width(A).height(B).color(h.map(function(a,b){return a.color||c[b%c.length]}).filter(function(a,b){return!h[b].disabled&&h[b].yAxis==1&&h[b].type=="area"})),r.width(A).height(B).color(h.map(function(a,b){return a.color||c[b%c.length]}).filter(function(a,b){return!h[b].disabled&&h[b].yAxis==2&&h[b].type=="area"})),M.attr("transform","translate("+b.left+","+b.top+")");var N=M.select(".lines1Wrap").datum(C),O=M.select(".bars1Wrap").datum(E),P=M.select(".stack1Wrap").datum(G),Q=M.select(".lines2Wrap").datum(D),R=M.select(".bars2Wrap").datum(F),S=M.select(".stack2Wrap").datum(H),T=G.length?G.map(function(a){return a.values}).reduce(function(a,b){return a.map(function(a,c){return{x:a.x,y:a.y+b[c].y}})}).concat([{x:0,y:0}]):[],U=H.length?H.map(function(a){return a.values}).reduce(function(a,b){return a.map(function(a,c){return{x:a.x,y:a.y+b[c].y}})}).concat([{x:0,y:0}]):[];k.domain(d3.extent(d3.merge(I).concat(T),function(a){return a.y})).range([0,B]),l.domain(d3.extent(d3.merge(J).concat(U),function(a){return a.y})).range([0,B]),m.yDomain(k.domain()),o.yDomain(k.domain()),q.yDomain(k.domain()),n.yDomain(l.domain()),p.yDomain(l.domain()),r.yDomain(l.domain()),G.length&&d3.transition(P).call(q),H.length&&d3.transition(S).call(r),E.length&&d3.transition(O).call(o),F.length&&d3.transition(R).call(p),C.length&&d3.transition(N).call(m),D.length&&d3.transition(Q).call(n),s.ticks(A/100).tickSize(-B,0),M.select(".x.axis").attr("transform","translate(0,"+B+")"),d3.transition(M.select(".x.axis")).call(s),t.ticks(B/36).tickSize(-A,0),d3.transition(M.select(".y1.axis")).call(t),u.ticks(B/36).tickSize(-A,0),d3.transition(M.select(".y2.axis")).call(u),M.select(".y2.axis").style("opacity",J.length?1:0).attr("transform","translate("+i.range()[1]+",0)"),v.dispatch.on("legendClick",function(b,c){b.disabled=!b.disabled,h.filter(function(a){return!a.disabled}).length||h.map(function(a){a.disabled=!1,K.selectAll(".series").classed("disabled",!1);return a}),a.transition().call(y)}),w.on("tooltipShow",function(a){g&&x(a,z.parentNode)})}),y.update=function(){y(a)},y.container=this;return y}var b={top:30,right:20,bottom:50,left:60},c=d3.scale.category20().range(),d=null,e=null,f=!0,g=!0,h=function(a,b,c,d,e){return"

"+a+"

"+"

"+c+" at "+b+"

"},i,j,i=d3.scale.linear(),k=d3.scale.linear(),l=d3.scale.linear(),m=a.models.line().yScale(k),n=a.models.line().yScale(l),o=a.models.multiBar().stacked(!1).yScale(k),p=a.models.multiBar().stacked(!1).yScale(l),q=a.models.stackedArea().yScale(k),r=a.models.stackedArea().yScale(l),s=a.models.axis().scale(i).orient("bottom").tickPadding(5),t=a.models.axis().scale(k).orient("left"),u=a.models.axis().scale(l).orient("right"),v=a.models.legend().height(30),w=d3.dispatch("tooltipShow","tooltipHide"),x=function(b,c){var d=b.pos[0]+(c.offsetLeft||0),e=b.pos[1]+(c.offsetTop||0),f=s.tickFormat()(m.x()(b.point,b.pointIndex)),g=(b.series.bar?t:u).tickFormat()(m.y()(b.point,b.pointIndex)),i=h(b.series.key,f,g,b,y);a.tooltip.show([d,e],i,undefined,undefined,c.offsetParent)};m.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+b.left,a.pos[1]+b.top],w.tooltipShow(a)}),m.dispatch.on("elementMouseout.tooltip",function(a){w.tooltipHide(a)}),n.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+b.left,a.pos[1]+b.top],w.tooltipShow(a)}),n.dispatch.on("elementMouseout.tooltip",function(a){w.tooltipHide(a)}),o.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+b.left,a.pos[1]+b.top],w.tooltipShow(a)}),o.dispatch.on("elementMouseout.tooltip",function(a){w.tooltipHide(a)}),p.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+b.left,a.pos[1]+b.top],w.tooltipShow(a)}),p.dispatch.on("elementMouseout.tooltip",function(a){w.tooltipHide(a)}),q.dispatch.on("tooltipShow",function(a){if(!Math.round(q.y()(a.point)*100)){setTimeout(function(){d3.selectAll(".point.hover").classed("hover",!1)},0);return!1}a.pos=[a.pos[0]+b.left,a.pos[1]+b.top],w.tooltipShow(a)}),q.dispatch.on("tooltipHide",function(a){w.tooltipHide(a)}),r.dispatch.on("tooltipShow",function(a){if(!Math.round(r.y()(a.point)*100)){setTimeout(function(){d3.selectAll(".point.hover").classed("hover",!1)},0);return!1}a.pos=[a.pos[0]+b.left,a.pos[1]+b.top],w.tooltipShow(a)}),r.dispatch.on("tooltipHide",function(a){w.tooltipHide(a)}),m.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+b.left,a.pos[1]+b.top],w.tooltipShow(a)}),m.dispatch.on("elementMouseout.tooltip",function(a){w.tooltipHide(a)}),n.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+b.left,a.pos[1]+b.top],w.tooltipShow(a)}),n.dispatch.on("elementMouseout.tooltip",function(a){w.tooltipHide(a)}),w.on("tooltipHide",function(){g&&a.tooltip.cleanup()}),y.dispatch=w,y.lines1=m,y.lines2=n,y.bars1= +o,y.bars2=p,y.stack1=q,y.stack2=r,y.xAxis=s,y.yAxis1=t,y.yAxis2=u,y.x=function(a){if(!arguments.length)return getX;getX=a,m.x(a),o.x(a);return y},y.y=function(a){if(!arguments.length)return getY;getY=a,m.y(a),o.y(a);return y},y.margin=function(a){if(!arguments.length)return b;b=a;return y},y.width=function(a){if(!arguments.length)return d;d=a;return y},y.height=function(a){if(!arguments.length)return e;e=a;return y},y.color=function(a){if(!arguments.length)return c;c=a,v.color(a);return y},y.showLegend=function(a){if(!arguments.length)return f;f=a;return y},y.tooltips=function(a){if(!arguments.length)return g;g=a;return y},y.tooltipContent=function(a){if(!arguments.length)return h;h=a;return y};return y},a.models.ohlcBar=function(){function v(a){a.each(function(a){var r=c-b.left-b.right,v=d-b.top-b.bottom,w=d3.select(this);f.domain(s||d3.extent(a[0].values.map(h).concat(n))),p?f.range([r*.5/a[0].values.length,r*(a[0].values.length-.5)/a[0].values.length]):f.range([0,r]),g.domain(t||[d3.min(a[0].values.map(m).concat(o)),d3.max(a[0].values.map(l).concat(o))]).range([v,0]);if(f.domain()[0]===f.domain()[1]||g.domain()[0]===g.domain()[1])singlePoint=!0;f.domain()[0]===f.domain()[1]&&(f.domain()[0]?f.domain([f.domain()[0]-f.domain()[0]*.01,f.domain()[1]+f.domain()[1]*.01]):f.domain([-1,1])),g.domain()[0]===g.domain()[1]&&(g.domain()[0]?g.domain([g.domain()[0]+g.domain()[0]*.01,g.domain()[1]-g.domain()[1]*.01]):g.domain([-1,1]));var z=d3.select(this).selectAll("g.nv-wrap.nv-ohlcBar").data([a[0].values]),A=z.enter().append("g").attr("class","nvd3 nv-wrap nv-ohlcBar"),B=A.append("defs"),C=A.append("g"),D=z.select("g");C.append("g").attr("class","nv-ticks"),z.attr("transform","translate("+b.left+","+b.top+")"),w.on("click",function(a,b){u.chartClick({data:a,index:b,pos:d3.event,id:e})}),B.append("clipPath").attr("id","nv-chart-clip-path-"+e).append("rect"),z.select("#nv-chart-clip-path-"+e+" rect").attr("width",r).attr("height",v),D.attr("clip-path",q?"url(#nv-chart-clip-path-"+e+")":"");var E=z.select(".nv-ticks").selectAll(".nv-tick").data(function(a){return a});E.exit().remove();var F=E.enter().append("path").attr("class",function(a,b,c){return(j(a,b)>k(a,b)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+c+"-"+b}).attr("d",function(b,c){var d=r/a[0].values.length*.9;return"m0,0l0,"+(g(j(b,c))-g(l(b,c)))+"l"+ -d/2+",0l"+d/2+",0l0,"+(g(m(b,c))-g(j(b,c)))+"l0,"+(g(k(b,c))-g(m(b,c)))+"l"+d/2+",0l"+ -d/2+",0z"}).attr("transform",function(a,b){return"translate("+f(h(a,b))+","+g(l(a,b))+")"}).on("mouseover",function(b,c){d3.select(this).classed("hover",!0),u.elementMouseover({point:b,series:a[0],pos:[f(h(b,c)),g(i(b,c))],pointIndex:c,seriesIndex:0,e:d3.event})}).on("mouseout",function(b,c){d3.select(this).classed("hover",!1),u.elementMouseout({point:b,series:a[0],pointIndex:c,seriesIndex:0,e:d3.event})}).on("click",function(a,b){u.elementClick({value:i(a,b),data:a,index:b,pos:[f(h(a,b)),g(i(a,b))],e:d3.event,id:e}),d3.event.stopPropagation()}).on("dblclick",function(a,b){u.elementDblClick({value:i(a,b),data:a,index:b,pos:[f(h(a,b)),g(i(a,b))],e:d3.event,id:e}),d3.event.stopPropagation()});E.attr("class",function(a,b,c){return(j(a,b)>k(a,b)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+c+"-"+b}),d3.transition(E).attr("transform",function(a,b){return"translate("+f(h(a,b))+","+g(l(a,b))+")"}).attr("d",function(b,c){var d=r/a[0].values.length*.9;return"m0,0l0,"+(g(j(b,c))-g(l(b,c)))+"l"+ -d/2+",0l"+d/2+",0l0,"+(g(m(b,c))-g(j(b,c)))+"l0,"+(g(k(b,c))-g(m(b,c)))+"l"+d/2+",0l"+ -d/2+",0z"})});return v}var b={top:0,right:0,bottom:0,left:0},c=960,d=500,e=Math.floor(Math.random()*1e4),f=d3.scale.linear(),g=d3.scale.linear(),h=function(a){return a.x},i=function(a){return a.y},j=function(a){return a.open},k=function(a){return a.close},l=function(a){return a.high},m=function(a){return a.low},n=[],o=[],p=!1,q=!0,r=a.utils.defaultColor(),s,t,u=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout");v.dispatch=u,v.x=function(a){if(!arguments.length)return h;h=a;return v},v.y=function(a){if(!arguments.length)return i;i=a;return v},v.open=function(a){if(!arguments.length)return j;j=a;return v},v.close=function(a){if(!arguments.length)return k;k=a;return v},v.high=function(a){if(!arguments.length)return l;l=a;return v},v.low=function(a){if(!arguments.length)return m;m=a;return v},v.margin=function(a){if(!arguments.length)return b;b.top=typeof a.top!="undefined"?a.top:b.top,b.right=typeof a.right!="undefined"?a.right:b.right,b.bottom=typeof a.bottom!="undefined"?a.bottom:b.bottom,b.left=typeof a.left!="undefined"?a.left:b.left;return v},v.width=function(a){if(!arguments.length)return c;c=a;return v},v.height=function(a){if(!arguments.length)return d;d=a;return v},v.xScale=function(a){if(!arguments.length)return f;f=a;return v},v.yScale=function(a){if(!arguments.length)return g;g=a;return v},v.xDomain=function(a){if(!arguments.length)return s;s=a;return v},v.yDomain=function(a){if(!arguments.length)return t;t=a;return v},v.forceX=function(a){if(!arguments.length)return n;n=a;return v},v.forceY=function(a){if(!arguments.length)return o;o=a;return v},v.padData=function(a){if(!arguments.length)return p;p=a;return v},v.clipEdge=function(a){if(!arguments.length)return q;q=a;return v},v.color=function(b){if(!arguments.length)return r;r=a.utils.getColor(b);return v},v.id=function(a){if(!arguments.length)return e;e=a;return v};return v},a.models.pie=function(){function q(a){a.each(function(a){function G(a){a.innerRadius=0;var b=d3.interpolate({startAngle:0,endAngle:0},a);return function(a){return y(b(a))}}function F(a){n||(a.innerRadius=0);var b=d3.interpolate(this._current,a);this._current=b(0);return function(a){return y(b(a))}}function E(a){var b=(a.startAngle+a.endAngle)*90/Math.PI-90;return b>90?b-180:b}var j=c-b.left-b.right,q=d-b.top-b.bottom,r=Math.min(j,q)/2,s=r-r/5,t=d3.select(this),u=t.selectAll(".nv-wrap.nv-pie").data([e(a[0])]),v=u.enter().append("g").attr("class","nvd3 nv-wrap nv-pie nv-chart-"+h),w=v.append("g"),x=u.select("g");w.append("g").attr("class","nv-pie"),u.attr("transform","translate("+b.left+","+b.top+")"),x.select(".nv-pie").attr("transform","translate("+j/2+","+q/2+")"),t.on("click",function(a,b){p.chartClick({data:a,index:b,pos:d3.event,id:h})});var y=d3.svg.arc().outerRadius(s);n&&y.innerRadius(r/2);var z=d3.layout.pie().sort(null).value(function(a){return a.disabled?0:g(a)}),A=u.select(".nv-pie").selectAll(".nv-slice").data(z);A.exit().remove();var B=A.enter().append("g").attr("class","nv-slice").on("mouseover",function(a,b){d3.select(this).classed("hover",!0),p.elementMouseover({label:f(a.data),value:g(a.data),point:a.data,pointIndex:b,pos:[d3.event.pageX,d3.event.pageY],id:h})}).on("mouseout",function(a,b){d3.select(this).classed("hover",!1),p.elementMouseout({label:f(a.data),value:g(a.data),point:a.data,index:b,id:h})}).on("click",function(a,b){p.elementClick({label:f(a.data),value:g(a.data),point:a.data,index:b,pos:d3.event,id:h}),d3.event.stopPropagation()}).on("dblclick",function(a,b){p.elementDblClick({label:f(a.data),value:g(a.data),point:a.data,index:b,pos:d3.event,id:h}),d3.event.stopPropagation()});A.attr("fill",function(a,b){return i(a,b)}).attr("stroke",function(a,b){return i(a,b)});var C=B.append("path").each(function(a){this._current=a});d3.transition(A.select("path")).attr("d",y).attrTween("d",F);if(k){var D=y;l&&(D=d3.svg.arc().outerRadius(y.outerRadius())),B.append("g").classed("nv-label",!0).each(function(a,b){var c=d3.select(this);c.attr("transform",function(a){if(o){a.outerRadius=s+10,a.innerRadius=s+15;var b=(a.startAngle+a.endAngle)/2*(180/Math.PI);(a.startAngle+a.endAngle)/2m?f(a.data):""});var d=c.select("text").node().getBBox();c.select(".nv-label rect").attr("width",d.width+10).attr("height",d.height+10).attr("transform",function(){return"translate("+[d.x-5,d.y-5]+")"})})}});return q}var b={top:0,right:0,bottom:0,left:0},c=500,d=500,e=function(a){return a.values},f=function(a){return a.x},g=function(a){return a.y},h=Math.floor(Math.random()*1e4),i=a.utils.defaultColor(),j=d3.format(",.2f"),k=!0,l=!1,m=.02,n=!1,o=!1,p=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout");q.dispatch=p,q.margin=function(a){if(!arguments.length)return b;b.top=typeof a.top!="undefined"?a.top:b.top,b.right=typeof a.right!="undefined"?a.right:b.right,b.bottom=typeof a.bottom!="undefined"?a.bottom:b.bottom,b.left=typeof a.left!="undefined"?a.left:b.left;return q},q.width=function(a){if(!arguments.length)return c;c=a;return q},q.height=function(a){if(!arguments.length)return d;d=a;return q},q.values=function(a){if(!arguments.length)return e;e=a;return q},q.x=function(a){if(!arguments.length)return f;f=a;return q},q.y=function(a){if(!arguments.length)return g;g=d3.functor(a);return q},q.showLabels=function(a){if(!arguments.length)return k;k=a;return q},q.labelSunbeamLayout=function(a){if(!arguments.length)return o;o=a;return q},q.donutLabelsOutside=function(a){if(!arguments.length)return l;l=a;return q},q.donut=function(a){if(!arguments.length)return n;n=a;return q},q.id=function(a){if(!arguments.length)return h;h=a;return q},q.color=function(b){if(!arguments.length)return i;i=a.utils.getColor(b);return q},q.valueFormat=function(a){if(!arguments.length)return j;j=a;return q},q.labelThreshold=function(a){if(!arguments.length)return m;m=a;return q};return q},a.models.pieChart=function(){function o(a){a.each(function(h){var i=d3.select(this),j=this,n=(e||parseInt(i.style("width"))||960)-d.left-d.right,p=(f||parseInt(i.style("height"))||400)-d.top-d.bottom;o.update=function(){o(a)},o.container=this;if(!h||!h.length){var q=i.selectAll(".nv-noData").data([l]);q.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),q.attr("x",d.left+n/2).attr("y",d.top+p/2).text(function(a){return a});return o}i.selectAll(".nv-noData").remove();var r=i.selectAll("g.nv-wrap.nv-pieChart").data([h]),s=r.enter().append("g").attr("class","nvd3 nv-wrap nv-pieChart").append("g"),t=r.select("g");s.append("g").attr("class","nv-pieWrap"),s.append("g").attr("class","nv-legendWrap"),g&&(c.width(n).key(b.x()),r.select(".nv-legendWrap").datum(b.values()(h[0])).call(c),d.top!=c.height()&&(d.top=c.height(),p=(f||parseInt(i.style("height"))||400)-d.top-d.bottom),r.select(".nv-legendWrap").attr("transform","translate(0,"+ -d.top+")")),r.attr("transform","translate("+d.left+","+d.top+")"),b.width(n).height(p);var u=t.select(".nv-pieWrap").datum(h);d3.transition(u).call(b),c.dispatch.on("legendClick",function(c,d,e){c.disabled=!c.disabled,b.values()(h[0]).filter(function(a){return!a.disabled}).length||b.values()(h[0]).map(function(a){a.disabled=!1,r.selectAll(".nv-series").classed("disabled",!1);return a}),k.disabled=h[0].map(function(a){return!!a.disabled}),m.stateChange(k),a.transition().call(o)}),b.dispatch.on("elementMouseout.tooltip",function(a){m.tooltipHide(a)}),m.on("changeState",function(b){typeof b.disabled!="undefined"&&(h[0].forEach(function(a,c){a.disabled=b.disabled[c]}),k.disabled=b.disabled),a.call(o)})});return o}var b=a.models.pie(),c=a.models.legend(),d={top:30,right:20,bottom:20,left:20},e=null,f=null,g=!0,h=a.utils.defaultColor(),i=!0,j=function(a,b,c,d){return"

"+a+"

"+"

"+b+"

"},k={},l="No Data Available.",m=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),n=function(c,d){var e=c.pos[0]+(d&&d.offsetLeft||0),f=c.pos[1]+(d&&d.offsetTop||0),g=b.valueFormat()(b.y()(c.point)),h=j(b.x()(c.point),g,c,o);a.tooltip.show([e,f],h,c.value<0?"n":"s",null,d)};b.dispatch.on("elementMouseover.tooltip",function(a){a.pos=[a.pos[0]+d.left,a.pos[1]+d.top],m.tooltipShow(a)}),m.on("tooltipShow",function(a){i&&n(a)}),m.on("tooltipHide",function(){i&&a.tooltip.cleanup()}),o.legend=c,o.dispatch=m,o.pie=b,d3.rebind(o,b,"valueFormat","values","x","y","id","showLabels","donutLabelsOutside","donut","labelThreshold"),o.margin=function(a){if(!arguments.length)return d;d.top=typeof a.top!="undefined"?a.top:d.top,d.right=typeof a.right!="undefined"?a.right:d.right,d.bottom=typeof a.bottom!="undefined"?a.bottom:d.bottom,d.left=typeof a.left!="undefined"?a.left:d.left;return o},o.width=function(a){if(!arguments.length)return e;e=a;return o},o.height=function(a){if(!arguments.length)return f;f=a;return o},o.color=function(d){if(!arguments.length)return h;h=a.utils.getColor(d),c.color(h),b.color(h);return o},o.showLegend=function(a){if(!arguments.length)return g;g=a;return o},o.tooltips=function(a){if(!arguments.length)return i;i=a;return o},o.tooltipContent=function(a){if(!arguments.length)return j;j=a;return o},o.state=function(a){if(!arguments.length)return k;k=a;return o},o.noData=function(a){if(!arguments.length)return l;l=a;return o};return o},a.models.scatter=function(){function J(a){a.each(function(a){function S(){if(!r)return!1;var e,i=d3.merge(a.map(function(a,b){return a.values.map(function(a,c){return[g(j(a,c))*(Math.random()/1e12+1),h(k(a,c))*(Math.random()/1e12+1),b,c,a]}).filter(function(a,b){return s(a[4],b)})}));if(D===!0){if(v){var l=N.select("defs").selectAll(".nv-point-clips").data([f]).enter();l.append("clipPath").attr("class","nv-point-clips").attr("id","nv-points-clip-"+f);var m=N.select("#nv-points-clip-"+f).selectAll("circle").data(i);m.enter().append("circle").attr("r",w),m.exit().remove(),m.attr("cx",function(a){return a[0]}).attr("cy",function(a){return a[1]}),N.select(".nv-point-paths").attr("clip-path","url(#nv-points-clip-"+f+")")}i.push([g.range()[0]-20,h.range()[0]-20,null,null]),i.push([g.range()[1]+20,h.range()[1]+20,null,null]),i.push([g.range()[0]-20,h.range()[0]+20,null,null]),i.push([g.range()[1]+20,h.range()[1]-20,null,null]);var n=d3.geom.polygon([[-10,-10],[-10,d+10],[c+10,d+10],[c+10,-10]]),o=d3.geom.voronoi(i).map(function(a,b){return{data:n.clip(a),series:i[b][2],point:i[b][3]}}),p=N.select(".nv-point-paths").selectAll("path").data(o);p.enter().append("path").attr("class",function(a,b){return"nv-path-"+b}),p.exit().remove(),p.attr("d",function(a){return"M"+a.data.join("L")+"Z"}),p.on("click",function(c){if(I)return 0;var d=a[c.series],e=d.values[c.point];C.elementClick({point:e,series:d,pos:[g(j(e,c.point))+b.left,h(k(e,c.point))+b.top],seriesIndex:c.series,pointIndex:c.point})}).on("mouseover",function(c){if(I)return 0;var d=a[c.series],e=d.values[c.point];C.elementMouseover({point:e,series:d,pos:[g(j(e,c.point))+b.left,h(k(e,c.point))+b.top],seriesIndex:c.series,pointIndex:c.point})}).on("mouseout",function(b,c){if(I)return 0;var d=a[b.series],e=d.values[b.point];C.elementMouseout({point:e,series:d,seriesIndex:b.series,pointIndex:b.point})})}else N.select(".nv-groups").selectAll(".nv-group").selectAll(".nv-point").on("click",function(c,d){if(I)return 0;var e=a[c.series],f=e.values[d];C.elementClick({point:f,series:e,pos:[g(j(f,d))+b.left,h(k(f,d))+b.top],seriesIndex:c.series,pointIndex:d})}).on("mouseover",function(c,d){if(I)return 0;var e=a[c.series],f=e.values[d];C.elementMouseover({point:f,series:e,pos:[g(j(f,d))+b.left,h(k(f,d))+b.top],seriesIndex:c.series,pointIndex:d})}).on("mouseout",function(b,c){if(I)return 0;var d=a[b.series],e=d.values[c];C.elementMouseout({point:e,series:d,seriesIndex:b.series,pointIndex:c})});I=!1}var J=c-b.left-b.right,K=d-b.top-b.bottom,L=d3.select(this);a=a.map(function(a,b){a.values=a.values.map(function(a){a.series=b;return a});return a});var M=x&&y&&z?[]:d3.merge(a.map(function(a){return a.values.map(function(a,b){return{x:j(a,b),y:k(a,b),size:l(a,b)}})}));g.domain(x||d3.extent(M.map(function(a){return a.x}).concat(o))),t?g.range([J*.5/a[0].values.length,J*(a[0].values.length-.5)/a[0].values.length]):g.range([0,J]),h.domain(y||d3.extent(M.map(function(a){return a.y}).concat(p))).range([K,0]),i.domain(z||d3.extent(M.map(function(a){return a.size}).concat(q))).range(A||[16,256]);if(g.domain()[0]===g.domain()[1]||h.domain()[0]===h.domain()[1])B=!0;g.domain()[0]===g.domain()[1]&&(g.domain()[0]?g.domain([g.domain()[0]-g.domain()[0]*.01,g.domain()[1]+g.domain()[1]*.01]):g.domain([-1,1])),h.domain()[0]===h.domain()[1]&&(h.domain()[0]?h.domain([h.domain()[0]+h.domain()[0]*.01,h.domain()[1]-h.domain()[1]*.01]):h.domain([-1,1])),E=E||g,F=F||h,G=G||i;var N=L.selectAll("g.nv-wrap.nv-scatter").data([a]),O=N.enter().append("g").attr("class","nvd3 nv-wrap nv-scatter nv-chart-"+f+(B?" nv-single-point":"")),P=O.append("defs"),Q=O.append("g"),R=N.select("g");Q.append("g").attr("class","nv-groups"),Q.append("g").attr("class","nv-point-paths"),N.attr("transform","translate("+b.left+","+b.top+")"),P.append("clipPath").attr("id","nv-edge-clip-"+f).append("rect"),N.select("#nv-edge-clip-"+f+" rect").attr("width",J).attr("height",K),R.attr("clip-path",u?"url(#nv-edge-clip-"+f+")":""),I=!0;var T=N.select(".nv-groups").selectAll(".nv-group").data(function(a){return a},function(a){return a.key});T.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),d3.transition(T.exit()).style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),T.attr("class",function(a,b){return"nv-group nv-series-"+b}).classed("hover",function(a){return a.hover}),d3.transition(T).style("fill",function(a,b){return e(a,b)}).style("stroke",function(a,b){return e(a,b)}).style("stroke-opacity",1).style("fill-opacity",.5);if(n){var U=T.selectAll("circle.nv-point").data(function(a){return a.values});U.enter().append("circle").attr("cx",function(a,b){return E(j(a,b))}).attr("cy",function(a,b){return F(k(a,b))}).attr("r",function(a,b){return Math.sqrt(i(l(a,b))/Math.PI)}),U.exit().remove(),d3.transition(T.exit().selectAll("path.nv-point")).attr("cx",function(a,b){return g(j(a,b))}).attr("cy",function(a,b){return h(k(a,b))}).remove(),U.attr("class",function(a,b){return"nv-point nv-point-"+b}),d3.transition(U).attr("cx",function(a,b){return g(j(a,b))}).attr("cy",function(a,b){return h(k(a,b))}).attr("r",function(a,b){return Math.sqrt(i(l(a,b))/Math.PI)})}else{var U=T.selectAll("path.nv-point").data(function(a){return a.values});U.enter().append("path").attr("transform",function(a,b){return"translate("+E(j(a,b))+","+F(k(a,b))+")"}).attr("d",d3.svg.symbol().type(m).size(function(a,b){return i(l(a,b))})),U.exit().remove(),d3.transition(T.exit().selectAll("path.nv-point")).attr("transform",function(a,b){return"translate("+g(j(a,b))+","+h(k(a,b))+")"}).remove(),U.attr("class",function(a,b){return"nv-point nv-point-"+b}),d3.transition(U).attr("transform",function(a,b){return"translate("+g(j(a,b))+","+h(k(a,b))+")"}).attr("d",d3.svg.symbol().type(m).size(function(a,b){return i(l(a,b))}))}clearTimeout(H),H=setTimeout(S,300),E=g.copy(),F=h.copy(),G=i.copy()});return J}var b={top:0,right:0,bottom:0,left:0},c=960,d=500,e=a.utils.defaultColor(),f=Math.floor(Math.random()*1e5),g=d3.scale.linear(),h=d3.scale.linear(),i=d3.scale.linear(),j=function(a){return a.x},k=function(a){return a.y},l=function(a){return a.size||1},m=function(a){return a.shape||"circle"},n=!0,o=[],p=[],q=[],r=!0,s=function(a){return!a.notActive},t=!1,u=!1,v=!0,w=function(){return 25},x=null,y=null,z=null,A=null,B=!1,C=d3.dispatch("elementClick","elementMouseover","elementMouseout"),D=!0,E,F,G,H,I=!1;C.on("elementMouseover.point",function(a){r&&d3.select(".nv-chart-"+f+" .nv-series-"+a.seriesIndex+" .nv-point-"+a.pointIndex).classed("hover",!0)}),C.on("elementMouseout.point",function(a){r&&d3.select(".nv-chart-"+f+" .nv-series-"+a.seriesIndex+" .nv-point-"+a.pointIndex).classed("hover",!1)}),J.dispatch=C,J.x=function(a){if(!arguments.length)return j;j=d3.functor(a);return J},J.y=function(a){if(!arguments.length)return k;k=d3.functor(a);return J},J.size=function(a){if(!arguments.length)return l;l=d3.functor(a);return J},J.margin=function(a){if(!arguments.length)return b;b.top=typeof a.top!="undefined"?a.top:b.top,b.right=typeof a.right!="undefined"?a.right:b.right,b.bottom=typeof a.bottom!="undefined"?a.bottom:b.bottom,b.left=typeof a.left!="undefined"?a.left:b.left;return J},J.width=function(a){if(!arguments.length)return c;c=a;return J},J.height=function(a){if(!arguments.length)return d;d=a;return J},J.xScale=function(a){if(!arguments.length)return g;g=a;return J},J.yScale=function(a){if(!arguments.length)return h;h=a;return J},J.zScale=function(a){if(!arguments.length)return i;i=a;return J},J.xDomain=function(a){if(!arguments.length)return x;x=a;return J},J.yDomain=function(a){if(!arguments.length)return y;y=a;return J},J.sizeDomain=function(a){if(!arguments.length)return z;z=a;return J},J.sizeRange=function(a){if(!arguments.length)return A;A=a;return J},J.forceX=function(a){if(!arguments.length)return o;o=a;return J},J.forceY=function(a){if(!arguments.length)return p;p=a;return J},J.forceSize=function(a){if(!arguments.length)return q;q=a;return J},J.interactive=function(a){if(!arguments.length)return r;r=a;return J},J.pointActive=function(a){if(!arguments.length)return s;s=a;return J},J.padData=function(a){if(!arguments.length)return t;t=a;return J},J.clipEdge=function(a){if(!arguments.length)return u;u=a;return J},J.clipVoronoi=function(a){if(!arguments.length)return v;v=a;return J},J.useVoronoi=function(a){if(!arguments.length)return D;D=a,D===!1&&(v=!1);return J},J.clipRadius=function(a){if(!arguments.length)return w;w=a;return J},J.color=function(b){if(!arguments.length)return e;e=a.utils.getColor(b);return J},J.shape=function(a){if(!arguments.length)return m;m=a;return J},J.onlyCircles=function(a){if(!arguments.length)return n;n=a;return J},J.id=function(a){if(!arguments.length)return f;f=a;return J},J.singlePoint=function(a){if(!arguments.length)return B;B=a;return J};return J},a.models.scatterChart=function(){function H(a){a.each(function(x){function R(){if(v){O.select(".nv-point-paths").style("pointer-events","all");return!1}O.select(".nv-point-paths").style("pointer-events","none");var a=d3.mouse(this);m.distortion(u).focus(a[0]),n.distortion(u).focus(a[1]),O.select(".nv-scatterWrap").call(b),O.select(".nv-x.nv-axis").call(c),O.select(".nv-y.nv-axis").call(d),O.select(".nv-distributionX").datum(x.filter(function(a){return!a.disabled})).call(g),O.select(".nv-distributionY").datum(x.filter(function(a){return!a.disabled})).call(h)}var y=d3.select(this),z=this,I=(j||parseInt(y.style("width"))||960)-i.left-i.right,J=(k||parseInt(y.style("height"))||400)-i.top-i.bottom;H.update=function(){H(a)},H.container=this;if(!x||!x.length||!x.filter(function(a){return a.values.length}).length){var K=y.selectAll(".nv-noData").data([B]);K.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),K.attr("x",i.left+I/2).attr("y",i.top+J/2).text(function(a){return a});return H}y.selectAll(".nv-noData").remove(),D=D||m,E=E||n;var L=y.selectAll("g.nv-wrap.nv-scatterChart").data([x]),M=L.enter().append("g").attr("class","nvd3 nv-wrap nv-scatterChart nv-chart-"+b.id()),N=M.append("g"),O=L.select("g");N.append("rect").attr("class","nvd3 nv-background"),N.append("g").attr("class","nv-x nv-axis"),N.append("g").attr("class","nv-y nv-axis"),N.append("g").attr("class","nv-scatterWrap"),N.append("g").attr("class","nv-distWrap"),N.append("g").attr("class","nv-legendWrap"),N.append("g").attr("class","nv-controlsWrap"),s&&(e.width(I/2),L.select(".nv-legendWrap").datum(x).call(e),i.top!=e.height()&&(i.top=e.height(),J=(k||parseInt(y.style("height"))||400)-i.top-i.bottom),L.select(".nv-legendWrap").attr("transform","translate("+I/2+","+ -i.top+")")),t&&(f.width(180).color(["#444"]),O.select(".nv-controlsWrap").datum(G).attr("transform","translate(0,"+ -i.top+")").call(f)),L.attr("transform","translate("+i.left+","+i.top+")"),b.width(I).height(J).color(x.map(function(a,b){return a.color||l(a,b)}).filter(function(a,b){return!x[b].disabled})),L.select(".nv-scatterWrap").datum(x.filter(function(a){return!a.disabled})).call(b);if(o){var P=m.domain()[1]-m.domain()[0];m.domain([m.domain()[0]-o*P,m.domain()[1]+o*P])}if(p){var Q=n.domain()[1]-n.domain()[0];n.domain([n.domain()[0]-p*Q,n.domain()[1]+p*Q])}c.scale(m).ticks(c.ticks()&&c.ticks().length?c.ticks():I/100).tickSize(-J,0),O.select(".nv-x.nv-axis").attr("transform","translate(0,"+n.range()[0]+")").call(c),d.scale(n).ticks(d.ticks()&&d.ticks().length?d.ticks():J/36).tickSize(-I,0),O.select(".nv-y.nv-axis").call(d),q&&(g.getData(b.x()).scale(m).width(I).color(x.map(function(a,b){return a.color||l(a,b)}).filter(function(a,b){return!x[b].disabled})),N.select(".nv-distWrap").append("g").attr("class","nv-distributionX"),O.select(".nv-distributionX").attr("transform","translate(0,"+n.range()[0]+")").datum(x.filter(function(a){return!a.disabled})).call(g)),r&&(h.getData(b.y()).scale(n).width(J).color(x.map(function(a,b){return a.color||l(a,b)}).filter(function(a,b){return!x[b].disabled})),N.select(".nv-distWrap").append("g").attr("class","nv-distributionY"),O.select(".nv-distributionY").attr("transform","translate(-"+h.size()+",0)").datum(x.filter(function(a){return!a.disabled})).call(h)),d3.fisheye&&(O.select(".nv-background").attr("width",I).attr("height",J),O.select(".nv-background").on("mousemove",R),O.select(".nv-background").on("click",function(){v=!v}),b.dispatch.on("elementClick.freezeFisheye",function(){v=!v})),f.dispatch.on("legendClick",function(e,f){e.disabled=!e.disabled,u=e.disabled?0:2.5,O.select(".nv-background").style("pointer-events",e.disabled?"none":"all"),O.select(".nv-point-paths").style("pointer-events",e.disabled?"all":"none"),e.disabled?(m.distortion(u).focus(0),n.distortion(u).focus(0),O.select(".nv-scatterWrap").call(b),O.select(".nv-x.nv-axis").call(c),O.select(".nv-y.nv-axis").call(d)):v=!1,H(a)}),e.dispatch.on("legendClick",function(b,c,d){b.disabled=!b.disabled,x.filter(function(a){return!a.disabled}).length||x.map(function(a){a.disabled=!1,L.selectAll(".nv-series").classed("disabled",!1);return a}),C.disabled=x.map(function(a){return!!a.disabled}),A.stateChange(C),H(a)}),b.dispatch.on("elementMouseover.tooltip",function(a){d3.select(".nv-chart-"+b.id()+" .nv-series-"+a.seriesIndex+" .nv-distx-"+a.pointIndex).attr("y1",a.pos[1]-J),d3.select(".nv-chart-"+b.id()+" .nv-series-"+a.seriesIndex+" .nv-disty-"+a.pointIndex).attr("x2",a.pos[0]+g.size()),a.pos=[a.pos[0]+i.left,a.pos[1]+i.top],A.tooltipShow(a)}),A.on("tooltipShow",function(a){w&&F(a,z.parentNode)}),A.on("changeState",function(b){typeof b.disabled!="undefined"&&(x.forEach(function(a,c){a.disabled=b.disabled[c]}),C.disabled=b.disabled),a.call(H)}),D=m.copy(),E=n.copy()});return H}var b=a.models.scatter(),c=a.models.axis(),d=a.models.axis(),e=a.models.legend(),f=a.models.legend(),g=a.models.distribution(),h=a.models.distribution(),i={top:30,right:20,bottom:50,left:75},j=null,k=null,l=a.utils.defaultColor(),m=d3.fisheye?d3.fisheye.scale(d3.scale.linear).distortion(0):b.xScale(),n=d3.fisheye?d3.fisheye.scale(d3.scale.linear).distortion(0):b.yScale(),o=0,p=0,q=!1,r=!1,s=!0,t=!!d3.fisheye,u=0,v=!1,w=!0,x=function(a,b,c){return""+b+""},y=function(a,b,c){return""+c+""},z=null,A=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),B="No Data Available.";b.xScale(m).yScale(n),c.orient("bottom").tickPadding(10),d.orient("left").tickPadding(10),g.axis("x"),h.axis("y");var C={},D,E,F=function(e,f){var g=e.pos[0]+(f.offsetLeft||0),h=e.pos[1]+(f.offsetTop||0),j=e.pos[0]+(f.offsetLeft||0),k=n.range()[0]+i.top+(f.offsetTop||0),l=m.range()[0]+i.left+(f.offsetLeft||0),o=e.pos[1]+(f.offsetTop||0),p=c.tickFormat()(b.x()(e.point,e.pointIndex)),q=d.tickFormat()(b.y()(e.point,e.pointIndex));x!=null&&a.tooltip.show([j,k],x(e.series.key,p,q,e,H),"n",1,f,"x-nvtooltip"),y!=null&&a.tooltip.show([l,o],y(e.series.key,p,q,e,H),"e",1,f,"y-nvtooltip"),z!=null&&a.tooltip.show([g,h],z(e.series.key,p,q,e,H),e.value<0?"n":"s",null,f)},G=[{key:"Magnify",disabled:!0}];b.dispatch.on("elementMouseout.tooltip",function(a){A.tooltipHide(a),d3.select(".nv-chart-"+b.id()+" .nv-series-"+a.seriesIndex+" .nv-distx-"+a.pointIndex).attr("y1",0),d3.select(".nv-chart-"+b.id()+" .nv-series-"+a.seriesIndex+" .nv-disty-"+a.pointIndex).attr("x2",h.size())}),A.on("tooltipHide",function(){w&&a.tooltip.cleanup()}),H.dispatch=A,H.scatter=b,H.legend=e,H.controls=f,H.xAxis=c,H.yAxis=d,H.distX=g,H.distY=h,d3.rebind(H,b,"id","interactive","pointActive","x","y","shape","size","xScale","yScale","zScale","xDomain","yDomain","sizeDomain","sizeRange","forceX","forceY","forceSize","clipVoronoi","clipRadius","useVoronoi"),H.margin=function(a){if(!arguments.length)return i;i.top=typeof a.top!="undefined"?a.top:i.top,i.right=typeof a.right!="undefined"?a.right:i.right,i.bottom=typeof a.bottom!="undefined"?a.bottom:i.bottom,i.left=typeof a.left!="undefined"?a.left:i.left;return H},H.width=function(a){if(!arguments.length)return j;j=a;return H},H.height=function(a){if(!arguments.length)return k;k=a;return H},H.color=function(b){if(!arguments.length)return l;l=a.utils.getColor(b),e.color(l),g.color(l),h.color(l);return H},H.showDistX=function(a){if(!arguments.length)return q;q=a;return H},H.showDistY=function(a){if(!arguments.length)return r;r=a;return H},H.showControls=function(a){if(!arguments.length)return t;t=a;return H},H.showLegend=function(a){if(!arguments.length)return s;s=a;return H},H.fisheye=function(a){if(!arguments.length)return u;u=a;return H},H.xPadding=function(a){if(!arguments.length)return o;o=a;return H},H.yPadding=function(a){if(!arguments.length)return p;p=a;return H},H.tooltips=function(a){if(!arguments.length)return w;w=a;return H},H.tooltipContent=function(a){if(!arguments.length)return z;z=a;return H},H.tooltipXContent=function(a){if(!arguments.length)return x;x=a;return H},H.tooltipYContent=function(a){if(!arguments.length)return y;y=a;return H},H.state=function(a){if(!arguments.length)return C;C=a;return H},H.noData=function(a){if(!arguments.length)return B;B=a;return H};return H},a.models.scatterPlusLineChart=function(){function F(a){a.each(function(v){function P(){if(t){M.select(".nv-point-paths").style("pointer-events","all");return!1}M.select(".nv-point-paths").style("pointer-events","none");var a=d3.mouse(this);m.distortion(s).focus(a[0]),n.distortion(s).focus(a[1]),M.select(".nv-scatterWrap").datum(v.filter(function(a){return!a.disabled})).call(b),M.select(".nv-x.nv-axis").call(c),M.select(".nv-y.nv-axis").call(d),M.select(".nv-distributionX").datum(v.filter(function(a){return!a.disabled})).call(g),M.select(".nv-distributionY").datum(v.filter(function(a){return!a.disabled})).call(h)}var w=d3.select(this),x=this,G=(j||parseInt(w.style("width"))||960)-i.left-i.right,H=(k||parseInt(w.style("height"))||400)-i.top-i.bottom;F.update=function(){F(a)},F.container=this;if(!v||!v.length||!v.filter(function(a){return a.values.length}).length){var I=w.selectAll(".nv-noData").data([z]);I.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),I.attr("x",i.left+G/2).attr("y",i.top+H/2).text(function(a){return a});return F}w.selectAll(".nv-noData").remove(),m=b.xScale(),n=b.yScale(),B=B||m,C=C||n;var J=w.selectAll("g.nv-wrap.nv-scatterChart").data([v]),K=J.enter().append("g").attr("class","nvd3 nv-wrap nv-scatterChart nv-chart-"+b.id()),L=K.append("g"),M=J.select("g");L.append("rect").attr("class","nvd3 nv-background"),L.append("g").attr("class","nv-x nv-axis"),L.append("g").attr("class","nv-y nv-axis"),L.append("g").attr("class","nv-scatterWrap"),L.append("g").attr("class","nv-regressionLinesWrap"),L.append("g").attr("class","nv-distWrap"),L.append("g").attr("class","nv-legendWrap"),L.append("g").attr("class","nv-controlsWrap"),J.attr("transform","translate("+i.left+","+i.top+")"),q&&(e.width(G/2),J.select(".nv-legendWrap").datum(v).call(e),i.top!=e.height()&&(i.top=e.height(),H=(k||parseInt(w.style("height"))||400)-i.top-i.bottom),J.select(".nv-legendWrap").attr("transform","translate("+G/2+","+ -i.top+")")),r&&(f.width(180).color(["#444"]),M.select +(".nv-controlsWrap").datum(E).attr("transform","translate(0,"+ -i.top+")").call(f)),b.width(G).height(H).color(v.map(function(a,b){return a.color||l(a,b)}).filter(function(a,b){return!v[b].disabled})),J.select(".nv-scatterWrap").datum(v.filter(function(a){return!a.disabled})).call(b),J.select(".nv-regressionLinesWrap").attr("clip-path","url(#nv-edge-clip-"+b.id()+")");var N=J.select(".nv-regressionLinesWrap").selectAll(".nv-regLines").data(function(a){return a}),O=N.enter().append("g").attr("class","nv-regLines").append("line").attr("class","nv-regLine").style("stroke-opacity",0);N.selectAll(".nv-regLines line").attr("x1",m.range()[0]).attr("x2",m.range()[1]).attr("y1",function(a,b){return n(m.domain()[0]*a.slope+a.intercept)}).attr("y2",function(a,b){return n(m.domain()[1]*a.slope+a.intercept)}).style("stroke",function(a,b,c){return l(a,c)}).style("stroke-opacity",function(a,b){return a.disabled||typeof a.slope=="undefined"||typeof a.intercept=="undefined"?0:1}),c.scale(m).ticks(c.ticks()?c.ticks():G/100).tickSize(-H,0),M.select(".nv-x.nv-axis").attr("transform","translate(0,"+n.range()[0]+")").call(c),d.scale(n).ticks(d.ticks()?d.ticks():H/36).tickSize(-G,0),M.select(".nv-y.nv-axis").call(d),o&&(g.getData(b.x()).scale(m).width(G).color(v.map(function(a,b){return a.color||l(a,b)}).filter(function(a,b){return!v[b].disabled})),L.select(".nv-distWrap").append("g").attr("class","nv-distributionX"),M.select(".nv-distributionX").attr("transform","translate(0,"+n.range()[0]+")").datum(v.filter(function(a){return!a.disabled})).call(g)),p&&(h.getData(b.y()).scale(n).width(H).color(v.map(function(a,b){return a.color||l(a,b)}).filter(function(a,b){return!v[b].disabled})),L.select(".nv-distWrap").append("g").attr("class","nv-distributionY"),M.select(".nv-distributionY").attr("transform","translate(-"+h.size()+",0)").datum(v.filter(function(a){return!a.disabled})).call(h)),d3.fisheye&&(M.select(".nv-background").attr("width",G).attr("height",H),M.select(".nv-background").on("mousemove",P),M.select(".nv-background").on("click",function(){t=!t}),b.dispatch.on("elementClick.freezeFisheye",function(){t=!t})),f.dispatch.on("legendClick",function(e,f){e.disabled=!e.disabled,s=e.disabled?0:2.5,M.select(".nv-background").style("pointer-events",e.disabled?"none":"all"),M.select(".nv-point-paths").style("pointer-events",e.disabled?"all":"none"),e.disabled?(m.distortion(s).focus(0),n.distortion(s).focus(0),M.select(".nv-scatterWrap").call(b),M.select(".nv-x.nv-axis").call(c),M.select(".nv-y.nv-axis").call(d)):t=!1,F(a)}),e.dispatch.on("legendClick",function(b,c,d){b.disabled=!b.disabled,v.filter(function(a){return!a.disabled}).length||v.map(function(a){a.disabled=!1,J.selectAll(".nv-series").classed("disabled",!1);return a}),A.disabled=v.map(function(a){return!!a.disabled}),y.stateChange(A),F(a)}),b.dispatch.on("elementMouseover.tooltip",function(a){d3.select(".nv-chart-"+b.id()+" .nv-series-"+a.seriesIndex+" .nv-distx-"+a.pointIndex).attr("y1",a.pos[1]-H),d3.select(".nv-chart-"+b.id()+" .nv-series-"+a.seriesIndex+" .nv-disty-"+a.pointIndex).attr("x2",a.pos[0]+g.size()),a.pos=[a.pos[0]+i.left,a.pos[1]+i.top],y.tooltipShow(a)}),y.on("tooltipShow",function(a){u&&D(a,x.parentNode)}),y.on("changeState",function(b){typeof b.disabled!="undefined"&&(v.forEach(function(a,c){a.disabled=b.disabled[c]}),A.disabled=b.disabled),a.call(F)}),B=m.copy(),C=n.copy()});return F}var b=a.models.scatter(),c=a.models.axis(),d=a.models.axis(),e=a.models.legend(),f=a.models.legend(),g=a.models.distribution(),h=a.models.distribution(),i={top:30,right:20,bottom:50,left:75},j=null,k=null,l=a.utils.defaultColor(),m=d3.fisheye?d3.fisheye.scale(d3.scale.linear).distortion(0):b.xScale(),n=d3.fisheye?d3.fisheye.scale(d3.scale.linear).distortion(0):b.yScale(),o=!1,p=!1,q=!0,r=!!d3.fisheye,s=0,t=!1,u=!0,v=function(a,b,c){return""+b+""},w=function(a,b,c){return""+c+""},x=function(a,b,c,d){return"

"+a+"

"+"

"+d+"

"},y=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),z="No Data Available.";b.xScale(m).yScale(n),c.orient("bottom").tickPadding(10),d.orient("left").tickPadding(10),g.axis("x"),h.axis("y");var A={},B,C,D=function(e,f){var g=e.pos[0]+(f.offsetLeft||0),h=e.pos[1]+(f.offsetTop||0),j=e.pos[0]+(f.offsetLeft||0),k=n.range()[0]+i.top+(f.offsetTop||0),l=m.range()[0]+i.left+(f.offsetLeft||0),o=e.pos[1]+(f.offsetTop||0),p=c.tickFormat()(b.x()(e.point,e.pointIndex)),q=d.tickFormat()(b.y()(e.point,e.pointIndex));v!=null&&a.tooltip.show([j,k],v(e.series.key,p,q,e,F),"n",1,f,"x-nvtooltip"),w!=null&&a.tooltip.show([l,o],w(e.series.key,p,q,e,F),"e",1,f,"y-nvtooltip"),x!=null&&a.tooltip.show([g,h],x(e.series.key,p,q,e.point.tooltip,e,F),e.value<0?"n":"s",null,f)},E=[{key:"Magnify",disabled:!0}];b.dispatch.on("elementMouseout.tooltip",function(a){y.tooltipHide(a),d3.select(".nv-chart-"+b.id()+" .nv-series-"+a.seriesIndex+" .nv-distx-"+a.pointIndex).attr("y1",0),d3.select(".nv-chart-"+b.id()+" .nv-series-"+a.seriesIndex+" .nv-disty-"+a.pointIndex).attr("x2",h.size())}),y.on("tooltipHide",function(){u&&a.tooltip.cleanup()}),F.dispatch=y,F.scatter=b,F.legend=e,F.controls=f,F.xAxis=c,F.yAxis=d,F.distX=g,F.distY=h,d3.rebind(F,b,"id","interactive","pointActive","x","y","shape","size","xScale","yScale","zScale","xDomain","yDomain","sizeDomain","sizeRange","forceX","forceY","forceSize","clipVoronoi","clipRadius","useVoronoi"),F.margin=function(a){if(!arguments.length)return i;i.top=typeof a.top!="undefined"?a.top:i.top,i.right=typeof a.right!="undefined"?a.right:i.right,i.bottom=typeof a.bottom!="undefined"?a.bottom:i.bottom,i.left=typeof a.left!="undefined"?a.left:i.left;return F},F.width=function(a){if(!arguments.length)return j;j=a;return F},F.height=function(a){if(!arguments.length)return k;k=a;return F},F.color=function(b){if(!arguments.length)return l;l=a.utils.getColor(b),e.color(l),g.color(l),h.color(l);return F},F.showDistX=function(a){if(!arguments.length)return o;o=a;return F},F.showDistY=function(a){if(!arguments.length)return p;p=a;return F},F.showControls=function(a){if(!arguments.length)return r;r=a;return F},F.showLegend=function(a){if(!arguments.length)return q;q=a;return F},F.fisheye=function(a){if(!arguments.length)return s;s=a;return F},F.tooltips=function(a){if(!arguments.length)return u;u=a;return F},F.tooltipContent=function(a){if(!arguments.length)return x;x=a;return F},F.tooltipXContent=function(a){if(!arguments.length)return v;v=a;return F},F.tooltipYContent=function(a){if(!arguments.length)return w;w=a;return F},F.state=function(a){if(!arguments.length)return A;A=a;return F},F.noData=function(a){if(!arguments.length)return z;z=a;return F};return F},a.models.sparkline=function(){function m(a){a.each(function(a){var e=c-b.left-b.right,m=d-b.top-b.bottom,n=d3.select(this);f.domain(k||d3.extent(a,h)).range([0,e]),g.domain(l||d3.extent(a,i)).range([m,0]);var o=n.selectAll("g.nv-wrap.nv-sparkline").data([a]),p=o.enter().append("g").attr("class","nvd3 nv-wrap nv-sparkline"),q=p.append("g"),r=o.select("g");o.attr("transform","translate("+b.left+","+b.top+")");var s=o.selectAll("path").data(function(a){return[a]});s.enter().append("path"),s.exit().remove(),s.style("stroke",function(a,b){return a.color||j(a,b)}).attr("d",d3.svg.line().x(function(a,b){return f(h(a,b))}).y(function(a,b){return g(i(a,b))}));var t=o.selectAll("circle.nv-point").data(function(a){function c(b){if(b!=-1){var c=a[b];c.pointIndex=b;return c}return null}var b=a.map(function(a,b){return i(a,b)}),d=c(b.lastIndexOf(g.domain()[1])),e=c(b.indexOf(g.domain()[0])),f=c(b.length-1);return[e,d,f].filter(function(a){return a!=null})});t.enter().append("circle"),t.exit().remove(),t.attr("cx",function(a,b){return f(h(a,a.pointIndex))}).attr("cy",function(a,b){return g(i(a,a.pointIndex))}).attr("r",2).attr("class",function(a,b){return h(a,a.pointIndex)==f.domain()[1]?"nv-point nv-currentValue":i(a,a.pointIndex)==g.domain()[0]?"nv-point nv-minValue":"nv-point nv-maxValue"})});return m}var b={top:2,right:0,bottom:2,left:0},c=400,d=32,e=!0,f=d3.scale.linear(),g=d3.scale.linear(),h=function(a){return a.x},i=function(a){return a.y},j=a.utils.getColor(["#000"]),k,l;m.margin=function(a){if(!arguments.length)return b;b.top=typeof a.top!="undefined"?a.top:b.top,b.right=typeof a.right!="undefined"?a.right:b.right,b.bottom=typeof a.bottom!="undefined"?a.bottom:b.bottom,b.left=typeof a.left!="undefined"?a.left:b.left;return m},m.width=function(a){if(!arguments.length)return c;c=a;return m},m.height=function(a){if(!arguments.length)return d;d=a;return m},m.x=function(a){if(!arguments.length)return h;h=d3.functor(a);return m},m.y=function(a){if(!arguments.length)return i;i=d3.functor(a);return m},m.xScale=function(a){if(!arguments.length)return f;f=a;return m},m.yScale=function(a){if(!arguments.length)return g;g=a;return m},m.xDomain=function(a){if(!arguments.length)return k;k=a;return m},m.yDomain=function(a){if(!arguments.length)return l;l=a;return m},m.animate=function(a){if(!arguments.length)return e;e=a;return m},m.color=function(b){if(!arguments.length)return j;j=a.utils.getColor(b);return m};return m},a.models.sparklinePlus=function(){function p(a){a.each(function(l){function F(){function d(a,c){var d=Math.abs(b.x()(a[0],0)-c),e=0;for(var f=0;f"+a+""+"

"+c+" on "+b+"

"},o,p,q=d3.format(",.2f"),r={style:b.style()},s="No Data Available.",t=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),u=250;c.orient("bottom").tickPadding(7),d.orient("left"),b.scatter.pointActive(function(a){return!!Math.round(b.y()(a)*100)});var v=function(e,f){var g=e.pos[0]+(f.offsetLeft||0),h=e.pos[1]+(f.offsetTop||0),i=c.tickFormat()(b.x()(e.point,e.pointIndex)),j=d.tickFormat()(b.y()(e.point,e.pointIndex)),k=n(e.series.key,i,j,e,w);a.tooltip.show([g,h],k,e.value<0?"n":"s",null,f)};b.dispatch.on("tooltipShow",function(a){a.pos=[a.pos[0]+g.left,a.pos[1]+g.top],t.tooltipShow(a)}),b.dispatch.on("tooltipHide",function(a){t.tooltipHide(a)}),t.on("tooltipHide",function(){m&&a.tooltip.cleanup()}),w.dispatch=t,w.stacked=b,w.legend=e,w.controls=f,w.xAxis=c,w.yAxis=d,d3.rebind(w,b,"x","y","size","xScale","yScale","xDomain","yDomain","sizeDomain","interactive","offset","order","style","clipEdge","forceX","forceY","forceSize","interpolate"),w.margin=function(a){if(!arguments.length)return g;g.top=typeof a.top!="undefined"?a.top:g.top,g.right=typeof a.right!="undefined"?a.right:g.right,g.bottom=typeof a.bottom!="undefined"?a.bottom:g.bottom,g.left=typeof a.left!="undefined"?a.left:g.left;return w},w.width=function(a){if(!arguments.length)return getWidth;h=a;return w},w.height=function(a){if(!arguments.length)return getHeight;i=a;return w},w.color=function(c){if(!arguments.length)return j;j=a.utils.getColor(c),e.color(j),b.color(j);return w},w.showControls=function(a){if(!arguments.length)return k;k=a;return w},w.showLegend=function(a){if(!arguments.length)return l;l=a;return w},w.tooltip=function(a){if(!arguments.length)return n;n=a;return w},w.tooltips=function(a){if(!arguments.length)return m;m=a;return w},w.tooltipContent=function(a){if(!arguments.length)return n;n=a;return w},w.state=function(a){if(!arguments.length)return r;r=a;return w},w.noData=function(a){if(!arguments.length)return s;s=a;return w},d.setTickFormat=d.tickFormat,d.tickFormat=function(a){if(!arguments.length)return q;q=a;return d};return w}})() \ No newline at end of file diff --git a/src/models/multiBar.js b/src/models/multiBar.js index 12c05b4..4ae83b3 100644 --- a/src/models/multiBar.js +++ b/src/models/multiBar.js @@ -17,6 +17,8 @@ nv.models.multiBar = function() { , clipEdge = true , stacked = false , color = nv.utils.defaultColor() + , barColor = null // adding the ability to set the color for each rather than the whole group + , disabled // used in conjunction with barColor to communicate from multiBarHorizontalChart what series are disabled , delay = 1200 , xDomain , yDomain @@ -235,6 +237,18 @@ nv.models.multiBar = function() { .attr('class', function(d,i) { return getY(d,i) < 0 ? 'nv-bar negative' : 'nv-bar positive'}) .attr('transform', function(d,i) { return 'translate(' + x(getX(d,i)) + ',0)'; }) + if (barColor) { + if (!disabled) disabled = data.map(function() { return true }); + bars + //.style('fill', barColor) + //.style('stroke', barColor) + //.style('fill', function(d,i,j) { return d3.rgb(barColor(d,i)).darker(j).toString(); }) + //.style('stroke', function(d,i,j) { return d3.rgb(barColor(d,i)).darker(j).toString(); }) + .style('fill', function(d,i,j) { return d3.rgb(barColor(d,i)).darker( disabled.map(function(d,i) { return i }).filter(function(d,i){ return !disabled[i] })[j] ).toString(); }) + .style('stroke', function(d,i,j) { return d3.rgb(barColor(d,i)).darker( disabled.map(function(d,i) { return i }).filter(function(d,i){ return !disabled[i] })[j] ).toString(); }); + } + + if (stacked) d3.transition(bars) .delay(function(d,i) { return i * delay / data[0].values.length }) @@ -371,6 +385,18 @@ nv.models.multiBar = function() { return chart; }; + chart.barColor = function(_) { + if (!arguments.length) return barColor; + barColor = nv.utils.getColor(_); + return chart; + }; + + chart.disabled = function(_) { + if (!arguments.length) return disabled; + disabled = _; + return chart; + }; + chart.id = function(_) { if (!arguments.length) return id; id = _; diff --git a/src/models/multiBarChart.js b/src/models/multiBarChart.js index 0ce0f5b..03d945f 100644 --- a/src/models/multiBarChart.js +++ b/src/models/multiBarChart.js @@ -136,6 +136,11 @@ nv.models.multiBarChart = function() { if (showLegend) { legend.width(availableWidth / 2); + if (multibar.barColor()) + data.forEach(function(series,i) { + series.color = d3.rgb('#ccc').darker(i * 1.5).toString(); + }) + g.select('.nv-legendWrap') .datum(data) .call(legend); @@ -179,6 +184,7 @@ nv.models.multiBarChart = function() { // Main Chart Component(s) multibar + .disabled(data.map(function(series) { return series.disabled })) .width(availableWidth) .height(availableHeight) .color(data.map(function(d,i) { @@ -348,7 +354,7 @@ nv.models.multiBarChart = function() { chart.xAxis = xAxis; chart.yAxis = yAxis; - d3.rebind(chart, multibar, 'x', 'y', 'xDomain', 'yDomain', 'forceX', 'forceY', 'clipEdge', 'id', 'stacked', 'delay'); + d3.rebind(chart, multibar, 'x', 'y', 'xDomain', 'yDomain', 'forceX', 'forceY', 'clipEdge', 'id', 'stacked', 'delay', 'barColor'); chart.margin = function(_) { if (!arguments.length) return margin; diff --git a/src/models/multiBarHorizontalChart.js b/src/models/multiBarHorizontalChart.js index cd50e18..6f612c4 100644 --- a/src/models/multiBarHorizontalChart.js +++ b/src/models/multiBarHorizontalChart.js @@ -137,7 +137,7 @@ nv.models.multiBarHorizontalChart = function() { if (multibar.barColor()) data.forEach(function(series,i) { - series.color = d3.rgb('#bbb').darker(i * 2).toString(); + series.color = d3.rgb('#ccc').darker(i * 1.5).toString(); }) g.select('.nv-legendWrap')