From: Ant Zucaro Date: Sat, 14 Sep 2013 19:03:13 +0000 (-0400) Subject: Allow overriding the line chart tooltip() function. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a329e8256235195c62bf10705f8c7c7901c33926;p=xonotic%2Fxonstat.git Allow overriding the line chart tooltip() function. --- diff --git a/xonstat/static/js/nv.d3.js b/xonstat/static/js/nv.d3.js index 5b19a49..2ced9ff 100644 --- a/xonstat/static/js/nv.d3.js +++ b/xonstat/static/js/nv.d3.js @@ -142,7 +142,7 @@ nv.interactiveGuideline = function() { , yScale = d3.scale.linear() , dispatch = d3.dispatch('elementMousemove', 'elementMouseout') , showGuideLine = true - , svgContainer = null + , svgContainer = null //Must pass in the bounding chart's container. //The mousemove event is attached to this container. ; @@ -155,16 +155,16 @@ nv.interactiveGuideline = function() { function layer(selection) { selection.each(function(data) { var container = d3.select(this); - + var availableWidth = (width || 960), availableHeight = (height || 400); var wrap = container.selectAll("g.nv-wrap.nv-interactiveLineLayer").data([data]); var wrapEnter = wrap.enter() .append("g").attr("class", " nv-wrap nv-interactiveLineLayer"); - - + + wrapEnter.append("g").attr("class","nv-interactiveGuideLine"); - + if (!svgContainer) { return; } @@ -181,7 +181,7 @@ nv.interactiveGuideline = function() { d3.mouse() returns incorrect X,Y mouse coordinates when mouse moving over a rect in IE 10. However, d3.event.offsetX/Y also returns the mouse coordinates - relative to the triggering . So we use offsetX/Y on IE. + relative to the triggering . So we use offsetX/Y on IE. */ mouseX = d3.event.offsetX; mouseY = d3.event.offsetY; @@ -192,7 +192,7 @@ nv.interactiveGuideline = function() { When this happens on IE, the offsetX/Y is set to where ever the child element is located. As a result, we do NOT need to subtract margins to figure out the mouse X/Y - position under this scenario. Removing the line below *will* cause + position under this scenario. Removing the line below *will* cause the interactive layer to not work right on IE. */ if(d3.event.target.tagName !== "svg") @@ -200,7 +200,7 @@ nv.interactiveGuideline = function() { if (d3.event.target.className.baseVal.match("nv-legend")) mouseOutAnyReason = true; - + } if(subtractMargin) { @@ -211,14 +211,14 @@ nv.interactiveGuideline = function() { /* If mouseX/Y is outside of the chart's bounds, trigger a mouseOut event. */ - if (mouseX < 0 || mouseY < 0 + if (mouseX < 0 || mouseY < 0 || mouseX > availableWidth || mouseY > availableHeight || (d3.event.relatedTarget && d3.event.relatedTarget.ownerSVGElement === undefined) || mouseOutAnyReason - ) + ) { if (isMSIE) { - if (d3.event.relatedTarget + if (d3.event.relatedTarget && d3.event.relatedTarget.ownerSVGElement === undefined && d3.event.relatedTarget.className.match(tooltip.nvPointerEventsClass)) { return; @@ -231,7 +231,7 @@ nv.interactiveGuideline = function() { layer.renderGuideLine(null); //hide the guideline return; } - + var pointXValue = xScale.invert(mouseX); dispatch.elementMousemove({ mouseX: mouseX, @@ -313,7 +313,7 @@ nv.interactiveGuideline = function() { /* Utility class that uses d3.bisect to find the index in a given array, where a search value can be inserted. This is different from normal bisectLeft; this function finds the nearest index to insert the search value. -For instance, lets say your array is [1,2,3,5,10,30], and you search for 28. +For instance, lets say your array is [1,2,3,5,10,30], and you search for 28. Normal d3.bisectLeft will return 4, because 28 is inserted after the number 10. But interactiveBisect will return 5 because 28 is closer to 30 than 10. @@ -354,7 +354,7 @@ window.nv.tooltip.* also has various helper methods. window.nv.tooltip = {}; /* Model which can be instantiated to handle tooltip rendering. - Example usage: + Example usage: var tip = nv.models.tooltip().gravity('w').distance(23) .data(myDataObject); @@ -366,7 +366,7 @@ window.nv.tooltip.* also has various helper methods. Format of data: { key: "Date", - value: "August 2009", + value: "August 2009", series: [ { key: "Series 1", @@ -421,7 +421,7 @@ window.nv.tooltip.* also has various helper methods. html += "
"; html += "
"; html += "" + item.key + ":"; - html += "" + valueFormatter(item.value,i) + ""; + html += "" + valueFormatter(item.value,i) + ""; }); } html += ""; @@ -445,7 +445,7 @@ window.nv.tooltip.* also has various helper methods. if (viewBox) { viewBox = viewBox.split(' '); var ratio = parseInt(svg.style('width')) / viewBox[2]; - + position.left = position.left * ratio; position.top = position.top * ratio; } @@ -468,7 +468,7 @@ window.nv.tooltip.* also has various helper methods. .attr("id",id) ; } - + container.node().innerHTML = newContent; container.style("top",0).style("left",0).style("opacity",0); @@ -477,7 +477,7 @@ window.nv.tooltip.* also has various helper methods. return container.node(); } - + //Draw the tooltip onto the DOM. function nvtooltip() { @@ -516,7 +516,7 @@ window.nv.tooltip.* also has various helper methods. }; nvtooltip.nvPointerEventsClass = nvPointerEventsClass; - + nvtooltip.content = function(_) { if (!arguments.length) return content; content = _; @@ -615,7 +615,7 @@ window.nv.tooltip.* also has various helper methods. //Original tooltip.show function. Kept for backward compatibility. // pos = [left,top] nv.tooltip.show = function(pos, content, gravity, dist, parentContainer, classes) { - + //Create new tooltip div if it doesn't exist on DOM. var container = document.createElement('div'); container.className = 'nvtooltip ' + (classes ? classes : 'xy-tooltip'); @@ -625,13 +625,13 @@ window.nv.tooltip.* also has various helper methods. //If the parent element is an SVG element, place tooltip in the element. body = document.getElementsByTagName('body')[0]; } - + container.style.left = 0; container.style.top = 0; container.style.opacity = 0; container.innerHTML = content; body.appendChild(container); - + //If the parent container is an overflow
with scrollbars, subtract the scroll offsets. if (parentContainer) { pos[0] = pos[0] - parentContainer.scrollLeft; @@ -652,7 +652,7 @@ window.nv.tooltip.* also has various helper methods. //Looks up the entire ancestry of an element, up to the first relatively positioned element. nv.tooltip.findTotalOffsetTop = function ( Elem, initialTop ) { var offsetTop = initialTop; - + do { if( !isNaN( Elem.offsetTop ) ) { offsetTop += (Elem.offsetTop); @@ -665,7 +665,7 @@ window.nv.tooltip.* also has various helper methods. //Looks up the entire ancestry of an element, up to the first relatively positioned element. nv.tooltip.findTotalOffsetLeft = function ( Elem, initialLeft) { var offsetLeft = initialLeft; - + do { if( !isNaN( Elem.offsetLeft ) ) { offsetLeft += (Elem.offsetLeft); @@ -752,7 +752,7 @@ window.nv.tooltip.* also has various helper methods. container.style.left = left+'px'; container.style.top = top+'px'; container.style.opacity = 1; - container.style.position = 'absolute'; + container.style.position = 'absolute'; return container; }; @@ -887,7 +887,7 @@ nv.utils.pjax = function(links, content) { } /* For situations where we want to approximate the width in pixels for an SVG:text element. -Most common instance is when the element is in a display:none; container. +Most common instance is when the element is in a display:none; container. Forumla is : text.length * font-size * constant_factor */ nv.utils.calcApproxTextWidth = function (svgTextElem) { @@ -895,7 +895,7 @@ nv.utils.calcApproxTextWidth = function (svgTextElem) { var fontSize = parseInt(svgTextElem.style("font-size").replace("px","")); var textLength = svgTextElem.text().length; - return textLength * fontSize * 0.5; + return textLength * fontSize * 0.5; } return 0; }; @@ -903,8 +903,8 @@ nv.utils.calcApproxTextWidth = function (svgTextElem) { /* Numbers that are undefined, null or NaN, convert them to zeros. */ nv.utils.NaNtoZero = function(n) { - if (typeof n !== 'number' - || isNaN(n) + if (typeof n !== 'number' + || isNaN(n) || n === null || n === Infinity) return 0; @@ -1185,7 +1185,7 @@ nv.utils.optionsFunc = function(args) { if (scale(d) < scale.range()[1] + 10 || scale(d) > scale.range()[0] - 10) { // 10 is assuming text height is 16... if d is 0, leave it! if (d > 1e-10 || d < -1e-10) // accounts for minor floating point errors... though could be problematic if the scale is EXTREMELY SMALL d3.select(this).attr('opacity', 0); - + d3.select(this).select('text').attr('opacity', 0); // Don't remove the ZERO line!! } }); @@ -1251,7 +1251,7 @@ nv.utils.optionsFunc = function(args) { d3.rebind(chart, scale, 'domain', 'range', 'rangeBand', 'rangeBands'); //these are also accessible by chart.scale(), but added common ones directly for ease of use chart.options = nv.utils.optionsFunc.bind(chart); - + chart.margin = function(_) { if(!arguments.length) return margin; margin.top = typeof _.top != 'undefined' ? _.top : margin.top; @@ -1541,14 +1541,14 @@ nv.models.bullet = function() { .attr('width', w0) .attr('height', availableHeight) .attr('x', reverse ? x0 : 0) - .on('mouseover', function(d,i) { + .on('mouseover', function(d,i) { dispatch.elementMouseover({ value: d, label: (i <= 0) ? 'Maximum' : (i > 1) ? 'Minimum' : 'Mean', //TODO: make these labels a variable pos: [x1(d), availableHeight/2] }) }) - .on('mouseout', function(d,i) { + .on('mouseout', function(d,i) { dispatch.elementMouseout({ value: d, label: (i <= 0) ? 'Minimum' : (i >=1) ? 'Maximum' : 'Mean' //TODO: make these labels a variable @@ -1572,14 +1572,14 @@ nv.models.bullet = function() { .attr('height', availableHeight / 3) .attr('x', reverse ? x0 : 0) .attr('y', availableHeight / 3) - .on('mouseover', function(d) { + .on('mouseover', function(d) { dispatch.elementMouseover({ value: d, label: 'Current', //TODO: make these labels a variable pos: [x1(d), availableHeight/2] }) }) - .on('mouseout', function(d) { + .on('mouseout', function(d) { dispatch.elementMouseout({ value: d, label: 'Current' //TODO: make these labels a variable @@ -1638,7 +1638,7 @@ nv.models.bullet = function() { chart.dispatch = dispatch; chart.options = nv.utils.optionsFunc.bind(chart); - + // left, right, top, bottom chart.orient = function(_) { if (!arguments.length) return orient; @@ -1975,7 +1975,7 @@ nv.models.bulletChart = function() { d3.rebind(chart, bullet, 'color'); chart.options = nv.utils.optionsFunc.bind(chart); - + // left, right, top, bottom chart.orient = function(x) { if (!arguments.length) return orient; @@ -2294,7 +2294,7 @@ nv.models.cumulativeLineChart = function() { gEnter.append('g').attr('class', 'nv-avgLinesWrap').style("pointer-events","none"); gEnter.append('g').attr('class', 'nv-legendWrap'); gEnter.append('g').attr('class', 'nv-controlsWrap'); - + //------------------------------------------------------------ // Legend @@ -2358,7 +2358,7 @@ nv.models.cumulativeLineChart = function() { //------------------------------------------------------------ // Main Chart Component(s) - + //------------------------------------------------------------ //Set up interactive layer if (useInteractiveGuideline) { @@ -2499,7 +2499,7 @@ nv.models.cumulativeLineChart = function() { function updateZero() { indexLine .data([index]); - + //When dragging the index line, turn off line transitions. // Then turn them back on when done dragging. var oldDuration = chart.transitionDuration(); @@ -2531,7 +2531,7 @@ nv.models.cumulativeLineChart = function() { updateZero(); }); - controls.dispatch.on('legendClick', function(d,i) { + controls.dispatch.on('legendClick', function(d,i) { d.disabled = !d.disabled; rescaleY = !d.disabled; @@ -2542,7 +2542,7 @@ nv.models.cumulativeLineChart = function() { legend.dispatch.on('stateChange', function(newState) { - state.disabled = newState.disabled; + state.disabled = newState.disabled; dispatch.stateChange(state); chart.update(); }); @@ -2551,9 +2551,9 @@ nv.models.cumulativeLineChart = function() { lines.clearHighlights(); var singlePoint, pointIndex, pointXLocation, allData = []; data - .filter(function(series, i) { + .filter(function(series, i) { series.seriesIndex = i; - return !series.disabled; + return !series.disabled; }) .forEach(function(series,i) { pointIndex = nv.interactiveBisect(series.values, e.pointXValue, chart.x()); @@ -2671,7 +2671,7 @@ nv.models.cumulativeLineChart = function() { d3.rebind(chart, lines, 'defined', 'isArea', 'x', 'y', 'xScale','yScale', 'size', 'xDomain', 'yDomain', 'xRange', 'yRange', 'forceX', 'forceY', 'interactive', 'clipEdge', 'clipVoronoi','useVoronoi', 'id'); chart.options = nv.utils.optionsFunc.bind(chart); - + chart.margin = function(_) { if (!arguments.length) return margin; margin.top = typeof _.top != 'undefined' ? _.top : margin.top; @@ -2955,7 +2955,7 @@ nv.models.discreteBar = function() { var barsEnter = bars.enter().append('g') .attr('transform', function(d,i,j) { - return 'translate(' + (x(getX(d,i)) + x.rangeBand() * .05 ) + ', ' + y(0) + ')' + return 'translate(' + (x(getX(d,i)) + x.rangeBand() * .05 ) + ', ' + y(0) + ')' }) .on('mouseover', function(d,i) { //TODO: figure out why j works above, but not here d3.select(this).classed('hover', true); @@ -3019,7 +3019,7 @@ nv.models.discreteBar = function() { .transition() .attr('x', x.rangeBand() * .9 / 2) .attr('y', function(d,i) { return getY(d,i) < 0 ? y(getY(d,i)) - y(0) + 12 : -4 }) - + ; } else { bars.selectAll('text').remove(); @@ -3068,7 +3068,7 @@ nv.models.discreteBar = function() { chart.dispatch = dispatch; chart.options = nv.utils.optionsFunc.bind(chart); - + chart.x = function(_) { if (!arguments.length) return getX; getX = _; @@ -3252,9 +3252,9 @@ nv.models.discreteBarChart = function() { - margin.top - margin.bottom; - chart.update = function() { - dispatch.beforeUpdate(); - container.transition().duration(transitionDuration).call(chart); + chart.update = function() { + dispatch.beforeUpdate(); + container.transition().duration(transitionDuration).call(chart); }; chart.container = this; @@ -3428,7 +3428,7 @@ nv.models.discreteBarChart = function() { d3.rebind(chart, discretebar, 'x', 'y', 'xDomain', 'yDomain', 'xRange', 'yRange', 'forceX', 'forceY', 'id', 'showValues', 'valueFormat'); chart.options = nv.utils.optionsFunc.bind(chart); - + chart.margin = function(_) { if (!arguments.length) return margin; margin.top = typeof _.top != 'undefined' ? _.top : margin.top; @@ -3609,7 +3609,7 @@ nv.models.distribution = function() { // Expose Public Variables //------------------------------------------------------------ chart.options = nv.utils.optionsFunc.bind(chart); - + chart.margin = function(_) { if (!arguments.length) return margin; margin.top = typeof _.top != 'undefined' ? _.top : margin.top; @@ -3775,7 +3775,7 @@ nv.models.historicalBar = function() { .attr('x', 0 ) .attr('y', function(d,i) { return nv.utils.NaNtoZero(y(Math.max(0, getY(d,i)))) }) .attr('height', function(d,i) { return nv.utils.NaNtoZero(Math.abs(y(getY(d,i)) - y(0))) }) - .attr('transform', function(d,i) { return 'translate(' + (x(getX(d,i)) - availableWidth / data[0].values.length * .45) + ',0)'; }) + .attr('transform', function(d,i) { return 'translate(' + (x(getX(d,i)) - availableWidth / data[0].values.length * .45) + ',0)'; }) .on('mouseover', function(d,i) { if (!interactive) return; d3.select(this).classed('hover', true); @@ -3831,7 +3831,7 @@ nv.models.historicalBar = function() { .attr('fill', function(d,i) { return color(d, i); }) .attr('class', function(d,i,j) { return (getY(d,i) < 0 ? 'nv-bar negative' : 'nv-bar positive') + ' nv-bar-' + j + '-' + i }) .transition() - .attr('transform', function(d,i) { return 'translate(' + (x(getX(d,i)) - availableWidth / data[0].values.length * .45) + ',0)'; }) + .attr('transform', function(d,i) { return 'translate(' + (x(getX(d,i)) - availableWidth / data[0].values.length * .45) + ',0)'; }) //TODO: better width calculations that don't assume always uniform data spacing;w .attr('width', (availableWidth / data[0].values.length) * .9 ); @@ -3873,7 +3873,7 @@ nv.models.historicalBar = function() { chart.dispatch = dispatch; chart.options = nv.utils.optionsFunc.bind(chart); - + chart.x = function(_) { if (!arguments.length) return getX; getX = _; @@ -4224,7 +4224,7 @@ nv.models.historicalBarChart = function() { // Event Handling/Dispatching (in chart's scope) //------------------------------------------------------------ - legend.dispatch.on('legendClick', function(d,i) { + legend.dispatch.on('legendClick', function(d,i) { d.disabled = !d.disabled; if (!data.filter(function(d) { return !d.disabled }).length) { @@ -4246,7 +4246,7 @@ nv.models.historicalBarChart = function() { data.forEach(function(d) { d.disabled = true; }); - d.disabled = false; + d.disabled = false; state.disabled = data.map(function(d) { return !!d.disabled }); dispatch.stateChange(state); @@ -4310,11 +4310,11 @@ nv.models.historicalBarChart = function() { chart.xAxis = xAxis; chart.yAxis = yAxis; - d3.rebind(chart, bars, 'defined', 'isArea', 'x', 'y', 'size', 'xScale', 'yScale', + d3.rebind(chart, bars, 'defined', 'isArea', 'x', 'y', 'size', 'xScale', 'yScale', 'xDomain', 'yDomain', 'xRange', 'yRange', 'forceX', 'forceY', 'interactive', 'clipEdge', 'clipVoronoi', 'id', 'interpolate','highlightPoint','clearHighlights', 'interactive'); chart.options = nv.utils.optionsFunc.bind(chart); - + chart.margin = function(_) { if (!arguments.length) return margin; margin.top = typeof _.top != 'undefined' ? _.top : margin.top; @@ -4571,28 +4571,28 @@ nv.models.indentedTree = function() { node .order() - .on('click', function(d) { + .on('click', function(d) { dispatch.elementClick({ row: this, //TODO: decide whether or not this should be consistent with scatter/line events or should be an html link (a href) data: d, pos: [d.x, d.y] }); }) - .on('dblclick', function(d) { + .on('dblclick', function(d) { dispatch.elementDblclick({ row: this, data: d, pos: [d.x, d.y] }); }) - .on('mouseover', function(d) { + .on('mouseover', function(d) { dispatch.elementMouseover({ row: this, data: d, pos: [d.x, d.y] }); }) - .on('mouseout', function(d) { + .on('mouseout', function(d) { dispatch.elementMouseout({ row: this, data: d, @@ -4658,7 +4658,7 @@ nv.models.indentedTree = function() { // Expose Public Variables //------------------------------------------------------------ chart.options = nv.utils.optionsFunc.bind(chart); - + chart.margin = function(_) { if (!arguments.length) return margin; margin.top = typeof _.top != 'undefined' ? _.top : margin.top; @@ -4823,7 +4823,7 @@ nv.models.indentedTree = function() { data.forEach(function(series) { series.disabled = true; }); - d.disabled = false; + d.disabled = false; dispatch.stateChange({ disabled: data.map(function(d) { return !!d.disabled }) }); @@ -4861,7 +4861,7 @@ nv.models.indentedTree = function() { catch(e) { nodeTextLength = nv.utils.calcApproxTextWidth(legendText); } - + seriesWidths.push(nodeTextLength + 28); // 28 is ~ the width of the circle plus some padding }); @@ -4952,7 +4952,7 @@ nv.models.indentedTree = function() { chart.dispatch = dispatch; chart.options = nv.utils.optionsFunc.bind(chart); - + chart.margin = function(_) { if (!arguments.length) return margin; margin.top = typeof _.top != 'undefined' ? _.top : margin.top; @@ -5043,7 +5043,7 @@ nv.models.line = function() { .size(16) // default size .sizeDomain([16,256]) //set to speed up calculation, needs to be unset if there is a custom size accessor ; - + //============================================================ @@ -5158,7 +5158,7 @@ nv.models.line = function() { }); groups.exit().selectAll('path.nv-area') .remove(); - + areaPaths .transition() .attr('d', function(d) { @@ -5223,11 +5223,11 @@ nv.models.line = function() { chart.dispatch = scatter.dispatch; chart.scatter = scatter; - d3.rebind(chart, scatter, 'id', 'interactive', 'size', 'xScale', 'yScale', 'zScale', 'xDomain', 'yDomain', 'xRange', 'yRange', + d3.rebind(chart, scatter, 'id', 'interactive', 'size', 'xScale', 'yScale', 'zScale', 'xDomain', 'yDomain', 'xRange', 'yRange', 'sizeDomain', 'forceX', 'forceY', 'forceSize', 'clipVoronoi', 'useVoronoi', 'clipRadius', 'padData','highlightPoint','clearHighlights'); chart.options = nv.utils.optionsFunc.bind(chart); - + chart.margin = function(_) { if (!arguments.length) return margin; margin.top = typeof _.top != 'undefined' ? _.top : margin.top; @@ -5381,7 +5381,7 @@ nv.models.lineChart = function() { //set state.disabled state.disabled = data.map(function(d) { return !!d.disabled }); - + if (!defaultState) { var key; defaultState = {}; @@ -5473,7 +5473,7 @@ nv.models.lineChart = function() { //------------------------------------------------------------ // Main Chart Component(s) - + //------------------------------------------------------------ //Set up interactive layer if (useInteractiveGuideline) { @@ -5546,9 +5546,9 @@ nv.models.lineChart = function() { lines.clearHighlights(); var singlePoint, pointIndex, pointXLocation, allData = []; data - .filter(function(series, i) { + .filter(function(series, i) { series.seriesIndex = i; - return !series.disabled; + return !series.disabled; }) .forEach(function(series,i) { pointIndex = nv.interactiveBisect(series.values, e.pointXValue, chart.x()); @@ -5714,6 +5714,12 @@ nv.models.lineChart = function() { return chart; }; + chart.tooltip = function(_) { + if (!arguments.length) return tooltip; + tooltip = _; + return chart; + }; + chart.tooltips = function(_) { if (!arguments.length) return tooltips; tooltips = _; @@ -6021,7 +6027,7 @@ nv.models.linePlusBarChart = function() { // Event Handling/Dispatching (in chart's scope) //------------------------------------------------------------ - legend.dispatch.on('stateChange', function(newState) { + legend.dispatch.on('stateChange', function(newState) { state = newState; dispatch.stateChange(state); chart.update(); @@ -6102,7 +6108,7 @@ nv.models.linePlusBarChart = function() { //d3.rebind(chart, lines, 'x', 'y', 'size', 'xDomain', 'yDomain', 'xRange', 'yRange', 'forceX', 'forceY', 'interactive', 'clipEdge', 'clipVoronoi', 'id'); chart.options = nv.utils.optionsFunc.bind(chart); - + chart.x = function(_) { if (!arguments.length) return getX; getX = _; @@ -6442,7 +6448,7 @@ nv.models.lineWithFocusChart = function() { .on('brush', function() { //When brushing, turn off transitions because chart needs to change immediately. var oldTransition = chart.transitionDuration(); - chart.transitionDuration(0); + chart.transitionDuration(0); onBrush(); chart.transitionDuration(oldTransition); }); @@ -6511,7 +6517,7 @@ nv.models.lineWithFocusChart = function() { // Event Handling/Dispatching (in chart's scope) //------------------------------------------------------------ - legend.dispatch.on('stateChange', function(newState) { + legend.dispatch.on('stateChange', function(newState) { chart.update(); }); @@ -6644,7 +6650,7 @@ nv.models.lineWithFocusChart = function() { d3.rebind(chart, lines, 'defined', 'isArea', 'size', 'xDomain', 'yDomain', 'xRange', 'yRange', 'forceX', 'forceY', 'interactive', 'clipEdge', 'clipVoronoi', 'id'); chart.options = nv.utils.optionsFunc.bind(chart); - + chart.x = function(_) { if (!arguments.length) return lines.x; lines.x(_); @@ -6744,7 +6750,7 @@ nv.models.lineWithFocusChart = function() { y2Axis.tickFormat(_); return chart; }; - + chart.brushExtent = function(_) { if (!arguments.length) return brushExtent; brushExtent = _; @@ -6930,7 +6936,7 @@ nv.models.linePlusBarWithFocusChart = function() { }); x .range([0, availableWidth]); - + x2 .domain(d3.extent(d3.merge(series1.concat(series2)), function(d) { return d.x } )) .range([0, availableWidth]); @@ -6946,7 +6952,7 @@ nv.models.linePlusBarWithFocusChart = function() { var g = wrap.select('g'); gEnter.append('g').attr('class', 'nv-legendWrap'); - + var focusEnter = gEnter.append('g').attr('class', 'nv-focus'); focusEnter.append('g').attr('class', 'nv-x nv-axis'); focusEnter.append('g').attr('class', 'nv-y1 nv-axis'); @@ -7013,13 +7019,13 @@ nv.models.linePlusBarWithFocusChart = function() { .color(data.map(function(d,i) { return d.color || color(d, i); }).filter(function(d,i) { return !data[i].disabled && !data[i].bar })); - + var bars2Wrap = g.select('.nv-context .nv-barsWrap') .datum(dataBars.length ? dataBars : [{values:[]}]); var lines2Wrap = g.select('.nv-context .nv-linesWrap') .datum(!dataLines[0].disabled ? dataLines : [{values:[]}]); - + g.select('.nv-context') .attr('transform', 'translate(0,' + ( availableHeight1 + margin.bottom + margin2.top) + ')') @@ -7087,10 +7093,10 @@ nv.models.linePlusBarWithFocusChart = function() { g.select('.nv-context .nv-y1.nv-axis') .style('opacity', dataBars.length ? 1 : 0) .attr('transform', 'translate(0,' + x2.range()[0] + ')'); - + g.select('.nv-context .nv-y1.nv-axis').transition() .call(y3Axis); - + y4Axis .scale(y4) @@ -7103,14 +7109,14 @@ nv.models.linePlusBarWithFocusChart = function() { g.select('.nv-context .nv-y2.nv-axis').transition() .call(y4Axis); - + //------------------------------------------------------------ //============================================================ // Event Handling/Dispatching (in chart's scope) //------------------------------------------------------------ - legend.dispatch.on('stateChange', function(newState) { + legend.dispatch.on('stateChange', function(newState) { chart.update(); }); @@ -7171,7 +7177,7 @@ nv.models.linePlusBarWithFocusChart = function() { //------------------------------------------------------------ // Prepare Main (Focus) Bars and Lines - + bars .width(availableWidth) .height(availableHeight1) @@ -7199,7 +7205,7 @@ nv.models.linePlusBarWithFocusChart = function() { } }) ); - + var focusLinesWrap = g.select('.nv-focus .nv-linesWrap') .datum(dataLines[0].disabled ? [{values:[]}] : dataLines @@ -7212,10 +7218,10 @@ nv.models.linePlusBarWithFocusChart = function() { } }) ); - + //------------------------------------------------------------ - - + + //------------------------------------------------------------ // Update Main (Focus) X Axis @@ -7224,31 +7230,31 @@ nv.models.linePlusBarWithFocusChart = function() { } else { x = lines.xScale(); } - + xAxis .scale(x) .ticks( availableWidth / 100 ) .tickSize(-availableHeight1, 0); xAxis.domain([Math.ceil(extent[0]), Math.floor(extent[1])]); - + g.select('.nv-x.nv-axis').transition().duration(transitionDuration) .call(xAxis); //------------------------------------------------------------ - - + + //------------------------------------------------------------ // Update Main (Focus) Bars and Lines focusBarsWrap.transition().duration(transitionDuration).call(bars); focusLinesWrap.transition().duration(transitionDuration).call(lines); - + //------------------------------------------------------------ - - + + //------------------------------------------------------------ // Setup and Update Main (Focus) Y Axes - + g.select('.nv-focus .nv-x.nv-axis') .attr('transform', 'translate(0,' + y1.range()[0] + ')'); @@ -7339,7 +7345,7 @@ nv.models.linePlusBarWithFocusChart = function() { //d3.rebind(chart, lines, 'x', 'y', 'size', 'xDomain', 'yDomain', 'xRange', 'yRange', 'forceX', 'forceY', 'interactive', 'clipEdge', 'clipVoronoi', 'id'); chart.options = nv.utils.optionsFunc.bind(chart); - + chart.x = function(_) { if (!arguments.length) return getX; getX = _; @@ -7510,7 +7516,7 @@ nv.models.multiBar = function() { f.y1 = negBase; negBase = negBase - f.size; } else - { + { f.y1 = f.size + posBase; posBase = posBase + f.size; } @@ -7589,7 +7595,7 @@ nv.models.multiBar = function() { groups.exit() .transition() .selectAll('rect.nv-bar') - .delay(function(d,i) { + .delay(function(d,i) { return i * delay/ data[0].values.length; }) .attr('y', function(d) { return stacked ? y0(d.y0) : y0(0) }) @@ -7687,7 +7693,7 @@ nv.models.multiBar = function() { if (stacked) bars.transition() - .delay(function(d,i) { + .delay(function(d,i) { return i * delay / data[0].values.length; }) @@ -7704,7 +7710,7 @@ nv.models.multiBar = function() { .attr('width', x.rangeBand() / (stacked ? 1 : data.length) ); else bars.transition() - .delay(function(d,i) { + .delay(function(d,i) { return i * delay/ data[0].values.length; }) .attr('x', function(d,i) { @@ -7741,7 +7747,7 @@ nv.models.multiBar = function() { chart.dispatch = dispatch; chart.options = nv.utils.optionsFunc.bind(chart); - + chart.x = function(_) { if (!arguments.length) return getX; getX = _; @@ -8131,7 +8137,7 @@ nv.models.multiBarChart = function() { // Issue #140 xTicks .selectAll("text") - .attr('transform', function(d,i,j) { + .attr('transform', function(d,i,j) { return getTranslate(0, (j % 2 == 0 ? staggerUp : staggerDown)); }); @@ -8155,13 +8161,13 @@ nv.models.multiBarChart = function() { .selectAll('.tick text') .attr('transform', 'rotate(' + rotateLabels + ' 0,0)') .style('text-anchor', rotateLabels > 0 ? 'start' : 'end'); - + g.select('.nv-x.nv-axis').selectAll('g.nv-axisMaxMin text') .style('opacity', 1); } - if (showYAxis) { + if (showYAxis) { yAxis .scale(y) .ticks( availableHeight / 36 ) @@ -8180,7 +8186,7 @@ nv.models.multiBarChart = function() { // Event Handling/Dispatching (in chart's scope) //------------------------------------------------------------ - legend.dispatch.on('stateChange', function(newState) { + legend.dispatch.on('stateChange', function(newState) { state = newState; dispatch.stateChange(state); chart.update(); @@ -8275,7 +8281,7 @@ nv.models.multiBarChart = function() { 'id', 'stacked', 'delay', 'barColor','groupSpacing'); chart.options = nv.utils.optionsFunc.bind(chart); - + chart.margin = function(_) { if (!arguments.length) return margin; margin.top = typeof _.top != 'undefined' ? _.top : margin.top; @@ -8382,7 +8388,7 @@ nv.models.multiBarChart = function() { defaultState = _; return chart; }; - + chart.noData = function(_) { if (!arguments.length) return noData; noData = _; @@ -8482,7 +8488,7 @@ nv.models.multiBarHorizontal = function() { f.y1 = negBase - f.size; negBase = negBase - f.size; } else - { + { f.y1 = posBase; posBase = posBase + f.size; } @@ -8659,7 +8665,7 @@ nv.models.multiBarHorizontal = function() { bars.transition() .attr('transform', function(d,i) { //TODO: stacked must be all positive or all negative, not both? - return 'translate(' + + return 'translate(' + (getY(d,i) < 0 ? y(getY(d,i)) : y(0)) + ',' + (d.series * x.rangeBand() / data.length @@ -8691,7 +8697,7 @@ nv.models.multiBarHorizontal = function() { chart.dispatch = dispatch; chart.options = nv.utils.optionsFunc.bind(chart); - + chart.x = function(_) { if (!arguments.length) return getX; getX = _; @@ -9080,7 +9086,7 @@ nv.models.multiBarHorizontalChart = function() { // Event Handling/Dispatching (in chart's scope) //------------------------------------------------------------ - legend.dispatch.on('stateChange', function(newState) { + legend.dispatch.on('stateChange', function(newState) { state = newState; dispatch.stateChange(state); chart.update(); @@ -9173,7 +9179,7 @@ nv.models.multiBarHorizontalChart = function() { d3.rebind(chart, multibar, 'x', 'y', 'xDomain', 'yDomain', 'xRange', 'yRange', 'forceX', 'forceY', 'clipEdge', 'id', 'delay', 'showValues', 'valueFormat', 'stacked', 'barColor'); chart.options = nv.utils.optionsFunc.bind(chart); - + chart.margin = function(_) { if (!arguments.length) return margin; margin.top = typeof _.top != 'undefined' ? _.top : margin.top; @@ -9268,7 +9274,7 @@ nv.models.multiChart = function() { var margin = {top: 30, right: 20, bottom: 50, left: 60}, color = d3.scale.category20().range(), - width = null, + width = null, height = null, showLegend = true, tooltips = true, @@ -9373,7 +9379,7 @@ nv.models.multiChart = function() { legend.width( availableWidth / 2 ); g.select('.legendWrap') - .datum(data.map(function(series) { + .datum(data.map(function(series) { series.originalKey = series.originalKey === undefined ? series.key : series.originalKey; series.key = series.originalKey + (series.yAxis == 1 ? '' : ' (right axis)'); return series; @@ -9481,7 +9487,7 @@ nv.models.multiChart = function() { if(dataLines1.length){d3.transition(lines1Wrap).call(lines1);} if(dataLines2.length){d3.transition(lines2Wrap).call(lines2);} - + xAxis @@ -9512,10 +9518,10 @@ nv.models.multiChart = function() { .style('opacity', series2.length ? 1 : 0) .attr('transform', 'translate(' + x.range()[1] + ',0)'); - legend.dispatch.on('stateChange', function(newState) { + legend.dispatch.on('stateChange', function(newState) { chart.update(); }); - + dispatch.on('tooltipShow', function(e) { if (tooltips) showTooltip(e, that.parentNode); }); @@ -10239,7 +10245,7 @@ nv.models.pie = function() { if (showLabels) { // This does the normal label var labelsArc = d3.svg.arc().innerRadius(0); - + if (pieLabelsOutside){ labelsArc = arc; } if (donutLabelsOutside) { labelsArc = d3.svg.arc().outerRadius(arc.outerRadius()); } @@ -10401,7 +10407,7 @@ nv.models.pie = function() { getY = d3.functor(_); return chart; }; - + chart.description = function(_) { if (!arguments.length) return getDescription; getDescription = _; @@ -10413,7 +10419,7 @@ nv.models.pie = function() { showLabels = _; return chart; }; - + chart.labelSunbeamLayout = function(_) { if (!arguments.length) return labelSunbeamLayout; labelSunbeamLayout = _; @@ -10425,7 +10431,7 @@ nv.models.pie = function() { donutLabelsOutside = _; return chart; }; - + chart.pieLabelsOutside = function(_) { if (!arguments.length) return pieLabelsOutside; pieLabelsOutside = _; @@ -10444,7 +10450,7 @@ nv.models.pie = function() { donut = _; return chart; }; - + chart.donutRatio = function(_) { if (!arguments.length) return donutRatio; donutRatio = _; @@ -10712,7 +10718,7 @@ nv.models.pieChart = function() { d3.rebind(chart, pie, 'valueFormat', 'values', 'x', 'y', 'description', 'id', 'showLabels', 'donutLabelsOutside', 'pieLabelsOutside', 'labelType', 'donut', 'donutRatio', 'labelThreshold'); chart.options = nv.utils.optionsFunc.bind(chart); - + chart.margin = function(_) { if (!arguments.length) return margin; margin.top = typeof _.top != 'undefined' ? _.top : margin.top; @@ -10954,9 +10960,9 @@ nv.models.scatter = function() { var pX = getX(point,pointIndex); var pY = getY(point,pointIndex); - return [x(pX)+ Math.random() * 1e-7, - y(pY)+ Math.random() * 1e-7, - groupIndex, + return [x(pX)+ Math.random() * 1e-7, + y(pY)+ Math.random() * 1e-7, + groupIndex, pointIndex, point]; //temp hack to add noise untill I think of a better way so there are no duplicates }) .filter(function(pointArray, pointIndex) { @@ -11024,17 +11030,17 @@ nv.models.scatter = function() { pointPaths.exit().remove(); pointPaths .attr('d', function(d) { - if (d.data.length === 0) + if (d.data.length === 0) return 'M 0 0' - else - return 'M' + d.data.join('L') + 'Z'; + else + return 'M' + d.data.join('L') + 'Z'; }); var mouseEventCallback = function(d,mDispatch) { if (needsUpdate) return 0; var series = data[d.series]; if (typeof series === 'undefined') return; - + var point = series.values[d.point]; mDispatch({ @@ -11075,7 +11081,7 @@ nv.models.scatter = function() { .selectAll('.nv-point') //.data(dataWithPoints) //.style('pointer-events', 'auto') // recativate events, disabled by css - .on('click', function(d,i) { + .on('click', function(d,i) { //nv.log('test', d, i); if (needsUpdate || !data[d.series]) return 0; //check if this is a dummy point var series = data[d.series], @@ -11234,7 +11240,7 @@ nv.models.scatter = function() { chart.highlightPoint = function(seriesIndex,pointIndex,isHoverOver) { d3.select(".nv-chart-" + id + " .nv-series-" + seriesIndex + " .nv-point-" + pointIndex) - .classed("hover",isHoverOver); + .classed("hover",isHoverOver); }; @@ -11255,7 +11261,7 @@ nv.models.scatter = function() { chart.dispatch = dispatch; chart.options = nv.utils.optionsFunc.bind(chart); - + chart.x = function(_) { if (!arguments.length) return getX; getX = d3.functor(_); @@ -11778,7 +11784,7 @@ nv.models.scatterChart = function() { gEnter.select('.nv-distWrap').append('g') .attr('class', 'nv-distributionY'); g.select('.nv-distributionY') - .attr('transform', + .attr('transform', 'translate(' + (rightAlignYAxis ? availableWidth : -distY.size() ) + ',0)') .datum(data.filter(function(d) { return !d.disabled })) .call(distY); @@ -11819,10 +11825,10 @@ nv.models.scatterChart = function() { if (showXAxis) g.select('.nv-x.nv-axis').call(xAxis); - + if (showYAxis) g.select('.nv-y.nv-axis').call(yAxis); - + g.select('.nv-distributionX') .datum(data.filter(function(d) { return !d.disabled })) .call(distX); @@ -11941,7 +11947,7 @@ nv.models.scatterChart = function() { d3.rebind(chart, scatter, 'id', 'interactive', 'pointActive', 'x', 'y', 'shape', 'size', 'xScale', 'yScale', 'zScale', 'xDomain', 'yDomain', 'xRange', 'yRange', 'sizeDomain', 'sizeRange', 'forceX', 'forceY', 'forceSize', 'clipVoronoi', 'clipRadius', 'useVoronoi'); chart.options = nv.utils.optionsFunc.bind(chart); - + chart.margin = function(_) { if (!arguments.length) return margin; margin.top = typeof _.top != 'undefined' ? _.top : margin.top; @@ -12069,7 +12075,7 @@ nv.models.scatterChart = function() { defaultState = _; return chart; }; - + chart.noData = function(_) { if (!arguments.length) return noData; noData = _; @@ -12121,7 +12127,7 @@ nv.models.scatterPlusLineChart = function() { , tooltips = true , tooltipX = function(key, x, y) { return '' + x + '' } , tooltipY = function(key, x, y) { return '' + y + '' } - , tooltip = function(key, x, y, date) { return '

' + key + '

' + , tooltip = function(key, x, y, date) { return '

' + key + '

' + '

' + date + '

' } , state = {} , defaultState = null @@ -12148,7 +12154,7 @@ nv.models.scatterPlusLineChart = function() { distY .axis('y') ; - + controls.updateState(false); //============================================================ @@ -12334,7 +12340,7 @@ nv.models.scatterPlusLineChart = function() { var regWrap = wrap.select('.nv-regressionLinesWrap').selectAll('.nv-regLines') .data(function(d) {return d }); - + regWrap.enter().append('g').attr('class', 'nv-regLines'); var regLine = regWrap.selectAll('.nv-regLine').data(function(d){return [d]}); @@ -12350,7 +12356,7 @@ nv.models.scatterPlusLineChart = function() { .attr('y2', function(d,i) { return y(x.domain()[1] * d.slope + d.intercept) }) .style('stroke', function(d,i,j) { return color(d,j) }) .style('stroke-opacity', function(d,i) { - return (d.disabled || typeof d.slope === 'undefined' || typeof d.intercept === 'undefined') ? 0 : 1 + return (d.disabled || typeof d.slope === 'undefined' || typeof d.intercept === 'undefined') ? 0 : 1 }); //------------------------------------------------------------ @@ -12453,7 +12459,7 @@ nv.models.scatterPlusLineChart = function() { if (showYAxis) g.select('.nv-y.nv-axis').call(yAxis); - + g.select('.nv-distributionX') .datum(data.filter(function(d) { return !d.disabled })) .call(distX); @@ -12489,7 +12495,7 @@ nv.models.scatterPlusLineChart = function() { chart.update(); }); - legend.dispatch.on('stateChange', function(newState) { + legend.dispatch.on('stateChange', function(newState) { state = newState; dispatch.stateChange(state); chart.update(); @@ -12574,7 +12580,7 @@ nv.models.scatterPlusLineChart = function() { d3.rebind(chart, scatter, 'id', 'interactive', 'pointActive', 'x', 'y', 'shape', 'size', 'xScale', 'yScale', 'zScale', 'xDomain', 'yDomain', 'xRange', 'yRange', 'sizeDomain', 'sizeRange', 'forceX', 'forceY', 'forceSize', 'clipVoronoi', 'clipRadius', 'useVoronoi'); chart.options = nv.utils.optionsFunc.bind(chart); - + chart.margin = function(_) { if (!arguments.length) return margin; margin.top = typeof _.top != 'undefined' ? _.top : margin.top; @@ -12814,7 +12820,7 @@ nv.models.sparkline = function() { // Expose Public Variables //------------------------------------------------------------ chart.options = nv.utils.optionsFunc.bind(chart); - + chart.margin = function(_) { if (!arguments.length) return margin; margin.top = typeof _.top != 'undefined' ? _.top : margin.top; @@ -12937,7 +12943,7 @@ nv.models.sparklinePlus = function() { availableHeight = (height || parseInt(container.style('height')) || 400) - margin.top - margin.bottom; - + chart.update = function() { chart(selection) }; chart.container = this; @@ -13012,7 +13018,7 @@ nv.models.sparklinePlus = function() { var valueWrap = g.select('.nv-valueWrap'); - + var value = valueWrap.selectAll('.nv-currentValue') .data([currentValue]); @@ -13133,7 +13139,7 @@ nv.models.sparklinePlus = function() { d3.rebind(chart, sparkline, 'x', 'y', 'xScale', 'yScale', 'color'); chart.options = nv.utils.optionsFunc.bind(chart); - + chart.margin = function(_) { if (!arguments.length) return margin; margin.top = typeof _.top != 'undefined' ? _.top : margin.top; @@ -13332,11 +13338,11 @@ nv.models.stackedArea = function() { var area = d3.svg.area() .x(function(d,i) { return x(getX(d,i)) }) - .y0(function(d) { - return y(d.display.y0) + .y0(function(d) { + return y(d.display.y0) }) - .y1(function(d) { - return y(d.display.y + d.display.y0) + .y1(function(d) { + return y(d.display.y + d.display.y0) }) .interpolate(interpolate); @@ -13384,13 +13390,13 @@ nv.models.stackedArea = function() { .attr('d', function(d,i) { return zeroArea(d.values,i) }) .remove(); path - .style('fill', function(d,i){ - return d.color || color(d, d.seriesIndex) + .style('fill', function(d,i){ + return d.color || color(d, d.seriesIndex) }) .style('stroke', function(d,i){ return d.color || color(d, d.seriesIndex) }); path.transition() - .attr('d', function(d,i) { - return area(d.values,i) + .attr('d', function(d,i) { + return area(d.values,i) }); @@ -13440,11 +13446,11 @@ nv.models.stackedArea = function() { chart.dispatch = dispatch; chart.scatter = scatter; - d3.rebind(chart, scatter, 'interactive', 'size', 'xScale', 'yScale', 'zScale', 'xDomain', 'yDomain', 'xRange', 'yRange', + d3.rebind(chart, scatter, 'interactive', 'size', 'xScale', 'yScale', 'zScale', 'xDomain', 'yDomain', 'xRange', 'yRange', 'sizeDomain', 'forceX', 'forceY', 'forceSize', 'clipVoronoi', 'useVoronoi','clipRadius','highlightPoint','clearHighlights'); chart.options = nv.utils.optionsFunc.bind(chart); - + chart.x = function(_) { if (!arguments.length) return getX; getX = d3.functor(_); @@ -13771,7 +13777,7 @@ nv.models.stackedAreaChart = function() { .xScale(x); wrap.select(".nv-interactive").call(interactiveLayer); } - + stacked .width(availableWidth) .height(availableHeight) @@ -13795,7 +13801,7 @@ nv.models.stackedAreaChart = function() { g.select('.nv-x.nv-axis') .attr('transform', 'translate(0,' + availableHeight + ')'); - + g.select('.nv-x.nv-axis') .transition().duration(0) .call(xAxis); @@ -13876,9 +13882,9 @@ nv.models.stackedAreaChart = function() { stacked.clearHighlights(); var singlePoint, pointIndex, pointXLocation, allData = []; data - .filter(function(series, i) { + .filter(function(series, i) { series.seriesIndex = i; - return !series.disabled; + return !series.disabled; }) .forEach(function(series,i) { pointIndex = nv.interactiveBisect(series.values, e.pointXValue, chart.x()); @@ -13993,7 +13999,7 @@ nv.models.stackedAreaChart = function() { d3.rebind(chart, stacked, 'x', 'y', 'size', 'xScale', 'yScale', 'xDomain', 'yDomain', 'xRange', 'yRange', 'sizeDomain', 'interactive', 'useVoronoi', 'offset', 'order', 'style', 'clipEdge', 'forceX', 'forceY', 'forceSize', 'interpolate'); chart.options = nv.utils.optionsFunc.bind(chart); - + chart.margin = function(_) { if (!arguments.length) return margin; margin.top = typeof _.top != 'undefined' ? _.top : margin.top; @@ -14125,4 +14131,4 @@ nv.models.stackedAreaChart = function() { return chart; } -})(); \ No newline at end of file +})(); diff --git a/xonstat/static/js/nv.d3.min.js b/xonstat/static/js/nv.d3.min.js index 2d0d347..cc56976 100644 --- a/xonstat/static/js/nv.d3.min.js +++ b/xonstat/static/js/nv.d3.min.js @@ -1,6 +1 @@ -(function(){function t(e,t){return(new Date(t,e+1,0)).getDate()}function n(e,t,n){return function(r,i,s){var o=e(r),u=[];o1)while(op||r>d||d3.event.relatedTarget&&d3.event.relatedTarget.ownerSVGElement===undefined||a){if(l&&d3.event.relatedTarget&&d3.event.relatedTarget.ownerSVGElement===undefined&&d3.event.relatedTarget.className.match(t.nvPointerEventsClass))return;u.elementMouseout({mouseX:n,mouseY:r}),c.renderGuideLine(null);return}var f=s.invert(n);u.elementMousemove({mouseX:n,mouseY:r,pointXValue:f})}var h=d3.select(this),p=n||960,d=r||400,v=h.selectAll("g.nv-wrap.nv-interactiveLineLayer").data([o]),m=v.enter().append("g").attr("class"," nv-wrap nv-interactiveLineLayer");m.append("g").attr("class","nv-interactiveGuideLine");if(!f)return;f.on("mousemove",g,!0).on("mouseout",g,!0),c.renderGuideLine=function(t){if(!a)return;var n=v.select(".nv-interactiveGuideLine").selectAll("line").data(t!=null?[e.utils.NaNtoZero(t)]:[],String);n.enter().append("line").attr("class","nv-guideline").attr("x1",function(e){return e}).attr("x2",function(e){return e}).attr("y1",d).attr("y2",0),n.exit().remove()}})}var t=e.models.tooltip(),n=null,r=null,i={left:0,top:0},s=d3.scale.linear(),o=d3.scale.linear(),u=d3.dispatch("elementMousemove","elementMouseout"),a=!0,f=null,l=navigator.userAgent.indexOf("MSIE")!==-1;return c.dispatch=u,c.tooltip=t,c.margin=function(e){return arguments.length?(i.top=typeof e.top!="undefined"?e.top:i.top,i.left=typeof e.left!="undefined"?e.left:i.left,c):i},c.width=function(e){return arguments.length?(n=e,c):n},c.height=function(e){return arguments.length?(r=e,c):r},c.xScale=function(e){return arguments.length?(s=e,c):s},c.showGuideLine=function(e){return arguments.length?(a=e,c):a},c.svgContainer=function(e){return arguments.length?(f=e,c):f},c},e.interactiveBisect=function(e,t,n){"use strict";if(!e instanceof Array)return null;typeof n!="function"&&(n=function(e,t){return e.x});var r=d3.bisector(n).left,i=d3.max([0,r(e,t)-1]),s=n(e[i],i);typeof s=="undefined"&&(s=i);if(s===t)return i;var o=d3.min([i+1,e.length-1]),u=n(e[o],o);return typeof u=="undefined"&&(u=o),Math.abs(u-t)>=Math.abs(s-t)?i:o},function(){"use strict";window.nv.tooltip={},window.nv.models.tooltip=function(){function g(){if(a){var e=d3.select(a);e.node().tagName!=="svg"&&(e=e.select("svg"));var t=e.node()?e.attr("viewBox"):null;if(t){t=t.split(" ");var n=parseInt(e.style("width"))/t[2];f.left=f.left*n,f.top=f.top*n}}}function y(e){var t;a?t=d3.select(a):t=d3.select("body");var n=t.select(".nvtooltip");return n.node()===null&&(n=t.append("div").attr("class","nvtooltip "+(u?u:"xy-tooltip")).attr("id",c)),n.node().innerHTML=e,n.style("top",0).style("left",0).style("opacity",0),n.selectAll("div, table, td, tr").classed(h,!0),n.classed(h,!0),n.node()}function b(){if(!l)return;if(!m(n))return;g();var t=f.left,u=o!=null?o:f.top,c=y(v(n));if(a){var h=a.getElementsByTagName("svg")[0],p=h?h.getBoundingClientRect():a.getBoundingClientRect(),d={left:0,top:0};if(h){var w=h.getBoundingClientRect(),E=a.getBoundingClientRect();d.top=Math.abs(w.top-E.top),d.left=Math.abs(w.left-E.left)}t+=a.offsetLeft+d.left-2*a.scrollLeft,u+=a.offsetTop+d.top-2*a.scrollTop}return s&&s>0&&(u=Math.floor(u/s)*s),e.tooltip.calcTooltipPosition([t,u],r,i,c),b}var t=null,n=null,r="w",i=50,s=25,o=null,u=null,a=null,f={left:null,top:null},l=!0,c="nvtooltip-"+Math.floor(Math.random()*1e5),h="nv-pointer-events-none",p=function(e,t){return e},d=function(e){return e},v=function(e){if(t!=null)return t;if(e==null)return"";var n="";return e.series instanceof Array&&e.series.forEach(function(e,t){n+="",n+="",n+="",n+=""}),n+="
"+d(e.value)+"
"+e.key+":"+p(e.value,t)+"
",n},m=function(e){return e&&e.series&&e.series.length>0?!0:!1};return b.nvPointerEventsClass=h,b.content=function(e){return arguments.length?(t=e,b):t},b.contentGenerator=function(e){return arguments.length?(typeof e=="function"&&(v=e),b):v},b.data=function(e){return arguments.length?(n=e,b):n},b.gravity=function(e){return arguments.length?(r=e,b):r},b.distance=function(e){return arguments.length?(i=e,b):i},b.snapDistance=function(e){return arguments.length?(s=e,b):s},b.classes=function(e){return arguments.length?(u=e,b):u},b.chartContainer=function(e){return arguments.length?(a=e,b):a},b.position=function(e){return arguments.length?(f.left=typeof e.left!="undefined"?e.left:f.left,f.top=typeof e.top!="undefined"?e.top:f.top,b):f},b.fixedTop=function(e){return arguments.length?(o=e,b):o},b.enabled=function(e){return arguments.length?(l=e,b):l},b.valueFormatter=function(e){return arguments.length?(typeof e=="function"&&(p=e),b):p},b.headerFormatter=function(e){return arguments.length?(typeof e=="function"&&(d=e),b):d},b.id=function(){return c},b},e.tooltip.show=function(t,n,r,i,s,o){var u=document.createElement("div");u.className="nvtooltip "+(o?o:"xy-tooltip");var a=s;if(!s||s.tagName.match(/g|svg/i))a=document.getElementsByTagName("body")[0];u.style.left=0,u.style.top=0,u.style.opacity=0,u.innerHTML=n,a.appendChild(u),s&&(t[0]=t[0]-s.scrollLeft,t[1]=t[1]-s.scrollTop),e.tooltip.calcTooltipPosition(t,r,i,u)},e.tooltip.findFirstNonSVGParent=function(e){while(e.tagName.match(/^g|svg$/i)!==null)e=e.parentNode;return e},e.tooltip.findTotalOffsetTop=function(e,t){var n=t;do isNaN(e.offsetTop)||(n+=e.offsetTop);while(e=e.offsetParent);return n},e.tooltip.findTotalOffsetLeft=function(e,t){var n=t;do isNaN(e.offsetLeft)||(n+=e.offsetLeft);while(e=e.offsetParent);return n},e.tooltip.calcTooltipPosition=function(t,n,r,i){var s=parseInt(i.offsetHeight),o=parseInt(i.offsetWidth),u=e.utils.windowSize().width,a=e.utils.windowSize().height,f=window.pageYOffset,l=window.pageXOffset,c,h;a=window.innerWidth>=document.body.scrollWidth?a:a-16,u=window.innerHeight>=document.body.scrollHeight?u:u-16,n=n||"s",r=r||20;var p=function(t){return e.tooltip.findTotalOffsetTop(t,h)},d=function(t){return e.tooltip.findTotalOffsetLeft(t,c)};switch(n){case"e":c=t[0]-o-r,h=t[1]-s/2;var v=d(i),m=p(i);vl?t[0]+r:l-v+c),mf+a&&(h=f+a-m+h-s);break;case"w":c=t[0]+r,h=t[1]-s/2;var v=d(i),m=p(i);v+o>u&&(c=t[0]-o-r),mf+a&&(h=f+a-m+h-s);break;case"n":c=t[0]-o/2-5,h=t[1]+r;var v=d(i),m=p(i);vu&&(c=c-o/2+5),m+s>f+a&&(h=f+a-m+h-s);break;case"s":c=t[0]-o/2,h=t[1]-s-r;var v=d(i),m=p(i);vu&&(c=c-o/2+5),f>m&&(h=f);break;case"none":c=t[0],h=t[1]-r;var v=d(i),m=p(i)}return i.style.left=c+"px",i.style.top=h+"px",i.style.opacity=1,i.style.position="absolute",i},e.tooltip.cleanup=function(){var e=document.getElementsByClassName("nvtooltip"),t=[];while(e.length)t.push(e[0]),e[0].style.transitionDelay="0 !important",e[0].style.opacity=0,e[0].className="nvtooltip-pending-removal";setTimeout(function(){while(t.length){var e=t.pop();e.parentNode.removeChild(e)}},500)}}(),e.utils.windowSize=function(){var e={width:640,height:480};return document.body&&document.body.offsetWidth&&(e.width=document.body.offsetWidth,e.height=document.body.offsetHeight),document.compatMode=="CSS1Compat"&&document.documentElement&&document.documentElement.offsetWidth&&(e.width=document.documentElement.offsetWidth,e.height=document.documentElement.offsetHeight),window.innerWidth&&window.innerHeight&&(e.width=window.innerWidth,e.height=window.innerHeight),e},e.utils.windowResize=function(e){if(e===undefined)return;var t=window.onresize;window.onresize=function(n){typeof t=="function"&&t(n),e(n)}},e.utils.getColor=function(t){return arguments.length?Object.prototype.toString.call(t)==="[object Array]"?function(e,n){return e.color||t[n%t.length]}:t:e.utils.defaultColor()},e.utils.defaultColor=function(){var e=d3.scale.category20().range();return function(t,n){return t.color||e[n%e.length]}},e.utils.customTheme=function(e,t,n){t=t||function(e){return e.key},n=n||d3.scale.category20().range();var r=n.length;return function(i,s){var o=t(i);return r||(r=n.length),typeof e[o]!="undefined"?typeof e[o]=="function"?e[o]():e[o]:n[--r]}},e.utils.pjax=function(t,n){function r(r){d3.html(r,function(r){var i=d3.select(n).node();i.parentNode.replaceChild(d3.select(r).select(n).node(),i),e.utils.pjax(t,n)})}d3.selectAll(t).on("click",function(){history.pushState(this.href,this.textContent,this.href),r(this.href),d3.event.preventDefault()}),d3.select(window).on("popstate",function(){d3.event.state&&r(d3.event.state)})},e.utils.calcApproxTextWidth=function(e){if(e instanceof d3.selection){var t=parseInt(e.style("font-size").replace("px","")),n=e.text().length;return n*t*.5}return 0},e.utils.NaNtoZero=function(e){return typeof e!="number"||isNaN(e)||e===null||e===Infinity?0:e},e.utils.optionsFunc=function(e){return e&&d3.map(e).forEach(function(e,t){typeof this[e]=="function"&&this[e](t)}.bind(this)),this},e.models.axis=function(){"use strict";function v(e){return e.each(function(e){var i=d3.select(this),v=i.selectAll("g.nv-wrap.nv-axis").data([e]),m=v.enter().append("g").attr("class","nvd3 nv-wrap nv-axis"),g=m.append("g"),y=v.select("g");p!==null?t.ticks(p):(t.orient()=="top"||t.orient()=="bottom")&&t.ticks(Math.abs(s.range()[1]-s.range()[0])/100),y.transition().call(t),d=d||t.scale();var b=t.tickFormat();b==null&&(b=d.tickFormat());var w=y.selectAll("text.nv-axislabel").data([o||null]);w.exit().remove();switch(t.orient()){case"top":w.enter().append("text").attr("class","nv-axislabel");var E=s.range().length==2?s.range()[1]:s.range()[s.range().length-1]+(s.range()[1]-s.range()[0]);w.attr("text-anchor","middle").attr("y",0).attr("x",E/2);if(u){var S=v.selectAll("g.nv-axisMaxMin").data(s.domain());S.enter().append("g").attr("class","nv-axisMaxMin").append("text"),S.exit().remove(),S.attr("transform",function(e,t){return"translate("+s(e)+",0)"}).select("text").attr("dy","0em").attr("y",-t.tickPadding()).attr("text-anchor","middle").text(function(e,t){var n=b(e);return(""+n).match("NaN")?"":n}),S.transition().attr("transform",function(e,t){return"translate("+s.range()[t]+",0)"})}break;case"bottom":var x=36,T=30,N=y.selectAll("g").select("text");if(f%360){N.each(function(e,t){var n=this.getBBox().width;n>T&&(T=n)});var C=Math.abs(Math.sin(f*Math.PI/180)),x=(C?C*T:T)+30;N.attr("transform",function(e,t,n){return"rotate("+f+" 0,0)"}).style("text-anchor",f%360>0?"start":"end")}w.enter().append("text").attr("class","nv-axislabel");var E=s.range().length==2?s.range()[1]:s.range()[s.range().length-1]+(s.range()[1]-s.range()[0]);w.attr("text-anchor","middle").attr("y",x).attr("x",E/2);if(u){var S=v.selectAll("g.nv-axisMaxMin").data([s.domain()[0],s.domain()[s.domain().length-1]]);S.enter().append("g").attr("class","nv-axisMaxMin").append("text"),S.exit().remove(),S.attr("transform",function(e,t){return"translate("+(s(e)+(h?s.rangeBand()/2:0))+",0)"}).select("text").attr("dy",".71em").attr("y",t.tickPadding()).attr("transform",function(e,t,n){return"rotate("+f+" 0,0)"}).style("text-anchor",f?f%360>0?"start":"end":"middle").text(function(e,t){var n=b(e);return(""+n).match("NaN")?"":n}),S.transition().attr("transform",function(e,t){return"translate("+(s(e)+(h?s.rangeBand()/2:0))+",0)"})}c&&N.attr("transform",function(e,t){return"translate(0,"+(t%2==0?"0":"12")+")"});break;case"right":w.enter().append("text").attr("class","nv-axislabel"),w.style("text-anchor",l?"middle":"begin").attr("transform",l?"rotate(90)":"").attr("y",l?-Math.max(n.right,r)+12:-10).attr("x",l?s.range()[0]/2:t.tickPadding());if(u){var S=v.selectAll("g.nv-axisMaxMin").data(s.domain());S.enter().append("g").attr("class","nv-axisMaxMin").append("text").style("opacity",0),S.exit().remove(),S.attr("transform",function(e,t){return"translate(0,"+s(e)+")"}).select("text").attr("dy",".32em").attr("y",0).attr("x",t.tickPadding()).style("text-anchor","start").text(function(e,t){var n=b(e);return(""+n).match("NaN")?"":n}),S.transition().attr("transform",function(e,t){return"translate(0,"+s.range()[t]+")"}).select("text").style("opacity",1)}break;case"left":w.enter().append("text").attr("class","nv-axislabel"),w.style("text-anchor",l?"middle":"end").attr("transform",l?"rotate(-90)":"").attr("y",l?-Math.max(n.left,r)+12:-10).attr("x",l?-s.range()[0]/2:-t.tickPadding());if(u){var S=v.selectAll("g.nv-axisMaxMin").data(s.domain());S.enter().append("g").attr("class","nv-axisMaxMin").append("text").style("opacity",0),S.exit().remove(),S.attr("transform",function(e,t){return"translate(0,"+d(e)+")"}).select("text").attr("dy",".32em").attr("y",0).attr("x",-t.tickPadding()).attr("text-anchor","end").text(function(e,t){var n=b(e);return(""+n).match("NaN")?"":n}),S.transition().attr("transform",function(e,t){return"translate(0,"+s.range()[t]+")"}).select("text").style("opacity",1)}}w.text(function(e){return e}),u&&(t.orient()==="left"||t.orient()==="right")&&(y.selectAll("g").each(function(e,t){d3.select(this).select("text").attr("opacity",1);if(s(e)s.range()[0]-10)(e>1e-10||e<-1e-10)&&d3.select(this).attr("opacity",0),d3.select(this).select("text").attr("opacity",0)}),s.domain()[0]==s.domain()[1]&&s.domain()[0]==0&&v.selectAll("g.nv-axisMaxMin").style("opacity",function(e,t){return t?0:1}));if(u&&(t.orient()==="top"||t.orient()==="bottom")){var k=[];v.selectAll("g.nv-axisMaxMin").each(function(e,t){try{t?k.push(s(e)-this.getBBox().width-4):k.push(s(e)+this.getBBox().width+4)}catch(n){t?k.push(s(e)-4):k.push(s(e)+4)}}),y.selectAll("g").each(function(e,t){if(s(e)k[1])e>1e-10||e<-1e-10?d3.select(this).remove():d3.select(this).select("text").remove()})}a&&y.selectAll(".tick").filter(function(e){return!parseFloat(Math.round(e.__data__*1e5)/1e6)&&e.__data__!==undefined}).classed("zero",!0),d=s.copy()}),v}var t=d3.svg.axis(),n={top:0,right:0,bottom:0,left:0},r=75,i=60,s=d3.scale.linear(),o=null,u=!0,a=!0,f=0,l=!0,c=!1,h=!1,p=null;t.scale(s).orient("bottom").tickFormat(function(e){return e});var d;return v.axis=t,d3.rebind(v,t,"orient","tickValues","tickSubdivide","tickSize","tickPadding","tickFormat"),d3.rebind(v,s,"domain","range","rangeBand","rangeBands"),v.options=e.utils.optionsFunc.bind(v),v.margin=function(e){return arguments.length?(n.top=typeof e.top!="undefined"?e.top:n.top,n.right=typeof e.right!="undefined"?e.right:n.right,n.bottom=typeof e.bottom!="undefined"?e.bottom:n.bottom,n.left=typeof e.left!="undefined"?e.left:n.left,v):n},v.width=function(e){return arguments.length?(r=e,v):r},v.ticks=function(e){return arguments.length?(p=e,v):p},v.height=function(e){return arguments.length?(i=e,v):i},v.axisLabel=function(e){return arguments.length?(o=e,v):o},v.showMaxMin=function(e){return arguments.length?(u=e,v):u},v.highlightZero=function(e){return arguments.length?(a=e,v):a},v.scale=function(e){return arguments.length?(s=e,t.scale(s),h=typeof s.rangeBands=="function",d3.rebind(v,s,"domain","range","rangeBand","rangeBands"),v):s},v.rotateYLabel=function(e){return arguments.length?(l=e,v):l},v.rotateLabels=function(e){return arguments.length?(f=e,v):f},v.staggerLabels=function(e){return arguments.length?(c=e,v):c},v},e.models.bullet=function(){"use strict";function m(e){return e.each(function(e,n){var p=c-t.left-t.right,m=h-t.top-t.bottom,g=d3.select(this),y=i.call(this,e,n).slice().sort(d3.descending),b=s.call(this,e,n).slice().sort(d3.descending),w=o.call(this,e,n).slice().sort(d3.descending),E=u.call(this,e,n).slice(),S=a.call(this,e,n).slice(),x=f.call(this,e,n).slice(),T=d3.scale.linear().domain(d3.extent(d3.merge([l,y]))).range(r?[p,0]:[0,p]),N=this.__chart__||d3.scale.linear().domain([0,Infinity]).range(T.range());this.__chart__=T;var C=d3.min(y),k=d3.max(y),L=y[1],A=g.selectAll("g.nv-wrap.nv-bullet").data([e]),O=A.enter().append("g").attr("class","nvd3 nv-wrap nv-bullet"),M=O.append("g"),_=A.select("g");M.append("rect").attr("class","nv-range nv-rangeMax"),M.append("rect").attr("class","nv-range nv-rangeAvg"),M.append("rect").attr("class","nv-range nv-rangeMin"),M.append("rect").attr("class","nv-measure"),M.append("path").attr("class","nv-markerTriangle"),A.attr("transform","translate("+t.left+","+t.top+")");var D=function(e){return Math.abs(N(e)-N(0))},P=function(e){return Math.abs(T(e)-T(0))},H=function(e){return e<0?N(e):N(0)},B=function(e){return e<0?T(e):T(0)};_.select("rect.nv-rangeMax").attr("height",m).attr("width",P(k>0?k:C)).attr("x",B(k>0?k:C)).datum(k>0?k:C),_.select("rect.nv-rangeAvg").attr("height",m).attr("width",P(L)).attr("x",B(L)).datum(L),_.select("rect.nv-rangeMin").attr("height",m).attr("width",P(k)).attr("x",B(k)).attr("width",P(k>0?C:k)).attr("x",B(k>0?C:k)).datum(k>0?C:k),_.select("rect.nv-measure").style("fill",d).attr("height",m/3).attr("y",m/3).attr("width",w<0?T(0)-T(w[0]):T(w[0])-T(0)).attr("x",B(w)).on("mouseover",function(){v.elementMouseover({value:w[0],label:x[0]||"Current",pos:[T(w[0]),m/2]})}).on("mouseout",function(){v.elementMouseout({value:w[0],label:x[0]||"Current"})});var j=m/6;b[0]?_.selectAll("path.nv-markerTriangle").attr("transform",function(e){return"translate("+T(b[0])+","+m/2+")"}).attr("d","M0,"+j+"L"+j+","+ -j+" "+ -j+","+ -j+"Z").on("mouseover",function(){v.elementMouseover({value:b[0],label:S[0]||"Previous",pos:[T(b[0]),m/2]})}).on("mouseout",function(){v.elementMouseout({value:b[0],label:S[0]||"Previous"})}):_.selectAll("path.nv-markerTriangle").remove(),A.selectAll(".nv-range").on("mouseover",function(e,t){var n=E[t]||(t?t==1?"Mean":"Minimum":"Maximum");v.elementMouseover({value:e,label:n,pos:[T(e),m/2]})}).on("mouseout",function(e,t){var n=E[t]||(t?t==1?"Mean":"Minimum":"Maximum");v.elementMouseout({value:e,label:n})})}),m}var t={top:0,right:0,bottom:0,left:0},n="left",r=!1,i=function(e){return e.ranges},s=function(e){return e.markers},o=function(e){return e.measures},u=function(e){return e.rangeLabels?e.rangeLabels:[]},a=function(e){return e.markerLabels?e.markerLabels:[]},f=function(e){return e.measureLabels?e.measureLabels:[]},l=[0],c=380,h=30,p=null,d=e.utils.getColor(["#1f77b4"]),v=d3.dispatch("elementMouseover","elementMouseout");return m.dispatch=v,m.options=e.utils.optionsFunc.bind(m),m.orient=function(e){return arguments.length?(n=e,r=n=="right"||n=="bottom",m):n},m.ranges=function(e){return arguments.length?(i=e,m):i},m.markers=function(e){return arguments.length?(s=e,m):s},m.measures=function(e){return arguments.length?(o=e,m):o},m.forceX=function(e){return arguments.length?(l=e,m):l},m.width=function(e){return arguments.length?(c=e,m):c},m.height=function(e){return arguments.length?(h=e,m):h},m.margin=function(e){return arguments.length?(t.top=typeof e.top!="undefined"?e.top:t.top,t.right=typeof e.right!="undefined"?e.right:t.right,t.bottom=typeof e.bottom!="undefined"?e.bottom:t.bottom,t.left=typeof e.left!="undefined"?e.left:t.left,m):t},m.tickFormat=function(e){return arguments.length?(p=e,m):p},m.color=function(t){return arguments.length?(d=e.utils.getColor(t),m):d},m},e.models.bulletChart=function(){"use strict";function m(e){return e.each(function(n,h){var g=d3.select(this),y=(a||parseInt(g.style("width"))||960)-i.left-i.right,b=f-i.top-i.bottom,w=this;m.update=function(){m(e)},m.container=this;if(!n||!s.call(this,n,h)){var E=g.selectAll(".nv-noData").data([p]);return E.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),E.attr("x",i.left+y/2).attr("y",18+i.top+b/2).text(function(e){return e}),m}g.selectAll(".nv-noData").remove();var S=s.call(this,n,h).slice().sort(d3.descending),x=o.call(this,n,h).slice().sort(d3.descending),T=u.call(this,n,h).slice().sort(d3.descending),N=g.selectAll("g.nv-wrap.nv-bulletChart").data([n]),C=N.enter().append("g").attr("class","nvd3 nv-wrap nv-bulletChart"),k=C.append("g"),L=N.select("g");k.append("g").attr("class","nv-bulletWrap"),k.append("g").attr("class","nv-titles"),N.attr("transform","translate("+i.left+","+i.top+")");var A=d3.scale.linear().domain([0,Math.max(S[0],x[0],T[0])]).range(r?[y,0]:[0,y]),O=this.__chart__||d3.scale.linear().domain([0,Infinity]).range(A.range());this.__chart__=A;var M=function(e){return Math.abs(O(e)-O(0))},_=function(e){return Math.abs(A(e)-A(0))},D=k.select(".nv-titles").append("g").attr("text-anchor","end").attr("transform","translate(-6,"+(f-i.top-i.bottom)/2+")");D.append("text").attr("class","nv-title").text(function(e){return e.title}),D.append("text").attr("class","nv-subtitle").attr("dy","1em").text(function(e){return e.subtitle}),t.width(y).height(b);var P=L.select(".nv-bulletWrap");d3.transition(P).call(t);var H=l||A.tickFormat(y/100),B=L.selectAll("g.nv-tick").data(A.ticks(y/50),function(e){return this.textContent||H(e)}),j=B.enter().append("g").attr("class","nv-tick").attr("transform",function(e){return"translate("+O(e)+",0)"}).style("opacity",1e-6);j.append("line").attr("y1",b).attr("y2",b*7/6),j.append("text").attr("text-anchor","middle").attr("dy","1em").attr("y",b*7/6).text(H);var F=d3.transition(B).attr("transform",function(e){return"translate("+A(e)+",0)"}).style("opacity",1);F.select("line").attr("y1",b).attr("y2",b*7/6),F.select("text").attr("y",b*7/6),d3.transition(B.exit()).attr("transform",function(e){return"translate("+A(e)+",0)"}).style("opacity",1e-6).remove(),d.on("tooltipShow",function(e){e.key=n.title,c&&v(e,w.parentNode)})}),d3.timer.flush(),m}var t=e.models.bullet(),n="left",r=!1,i={top:5,right:40,bottom:20,left:120},s=function(e){return e.ranges},o=function(e){return e.markers},u=function(e){return e.measures},a=null,f=55,l=null,c=!0,h=function(e,t,n,r,i){return"

"+t+"

"+"

"+n+"

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

"+e+"

"+"

"+n+" at "+t+"

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

"+t+"

"+"

"+n+"

"},d,v,m="No Data Available.",g=d3.dispatch("tooltipShow","tooltipHide","beforeUpdate"),y=250;n.orient("bottom").highlightZero(!1).showMaxMin(!1).tickFormat(function(e){return e}),r.orient(l?"right":"left").tickFormat(d3.format(",.1f"));var b=function(i,s){var o=i.pos[0]+(s.offsetLeft||0),u=i.pos[1]+(s.offsetTop||0),a=n.tickFormat()(t.x()(i.point,i.pointIndex)),f=r.tickFormat()(t.y()(i.point,i.pointIndex)),l=p(i.series.key,a,f,i,w);e.tooltip.show([o,u],l,i.value<0?"n":"s",null,s)};return t.dispatch.on("elementMouseover.tooltip",function(e){e.pos=[e.pos[0]+i.left,e.pos[1]+i.top],g.tooltipShow(e)}),t.dispatch.on("elementMouseout.tooltip",function(e){g.tooltipHide(e)}),g.on("tooltipHide",function(){h&&e.tooltip.cleanup()}),w.dispatch=g,w.discretebar=t,w.xAxis=n,w.yAxis=r,d3.rebind(w,t,"x","y","xDomain","yDomain","xRange","yRange","forceX","forceY","id","showValues","valueFormat"),w.options=e.utils.optionsFunc.bind(w),w.margin=function(e){return arguments.length?(i.top=typeof e.top!="undefined"?e.top:i.top,i.right=typeof e.right!="undefined"?e.right:i.right,i.bottom=typeof e.bottom!="undefined"?e.bottom:i.bottom,i.left=typeof e.left!="undefined"?e.left:i.left,w):i},w.width=function(e){return arguments.length?(s=e,w):s},w.height=function(e){return arguments.length?(o=e,w):o},w.color=function(n){return arguments.length?(u=e.utils.getColor(n),t.color(u),w):u},w.showXAxis=function(e){return arguments.length?(a=e,w):a},w.showYAxis=function(e){return arguments.length?(f=e,w):f},w.rightAlignYAxis=function(e){return arguments.length?(l=e,r.orient(e?"right":"left"),w):l},w.staggerLabels=function(e){return arguments.length?(c=e,w):c},w.tooltips=function(e){return arguments.length?(h=e,w):h},w.tooltipContent=function(e){return arguments.length?(p=e,w):p},w.noData=function(e){return arguments.length?(m=e,w):m},w.transitionDuration=function(e){return arguments.length?(y=e,w):y},w},e.models.distribution=function(){"use strict";function l(e){return e.each(function(e){var a=n-(i==="x"?t.left+t.right:t.top+t.bottom),l=i=="x"?"y":"x",c=d3.select(this);f=f||u;var h=c.selectAll("g.nv-distribution").data([e]),p=h.enter().append("g").attr("class","nvd3 nv-distribution"),d=p.append("g"),v=h.select("g");h.attr("transform","translate("+t.left+","+t.top+")");var m=v.selectAll("g.nv-dist").data(function(e){return e},function(e){return e.key});m.enter().append("g"),m.attr("class",function(e,t){return"nv-dist nv-series-"+t}).style("stroke",function(e,t){return o(e,t)});var g=m.selectAll("line.nv-dist"+i).data(function(e){return e.values});g.enter().append("line").attr(i+"1",function(e,t){return f(s(e,t))}).attr(i+"2",function(e,t){return f(s(e,t))}),m.exit().selectAll("line.nv-dist"+i).transition().attr(i+"1",function(e,t){return u(s(e,t))}).attr(i+"2",function(e,t){return u(s(e,t))}).style("stroke-opacity",0).remove(),g.attr("class",function(e,t){return"nv-dist"+i+" nv-dist"+i+"-"+t}).attr(l+"1",0).attr(l+"2",r),g.transition().attr(i+"1",function(e,t){return u(s(e,t))}).attr(i+"2",function(e,t){return u(s(e,t))}),f=u.copy()}),l}var t={top:0,right:0,bottom:0,left:0},n=400,r=8,i="x",s=function(e){return e[i]},o=e.utils.defaultColor(),u=d3.scale.linear(),a,f;return l.options=e.utils.optionsFunc.bind(l),l.margin=function(e){return arguments.length?(t.top=typeof e.top!="undefined"?e.top:t.top,t.right=typeof e.right!="undefined"?e.right:t.right,t.bottom=typeof e.bottom!="undefined"?e.bottom:t.bottom,t.left=typeof e.left!="undefined"?e.left:t.left,l):t},l.width=function(e){return arguments.length?(n=e,l):n},l.axis=function(e){return arguments.length?(i=e,l):i},l.size=function(e){return arguments.length?(r=e,l):r},l.getData=function(e){return arguments.length?(s=d3.functor(e),l):s},l.scale=function(e){return arguments.length?(u=e,l):u},l.color=function(t){return arguments.length?(o=e.utils.getColor(t),l):o},l},e.models.historicalBar=function(){"use strict";function w(E){return E.each(function(w){var E=n-t.left-t.right,S=r-t.top-t.bottom,T=d3.select(this);s.domain(d||d3.extent(w[0].values.map(u).concat(f))),c?s.range(m||[E*.5/w[0].values.length,E*(w[0].values.length-.5)/w[0].values.length]):s.range(m||[0,E]),o.domain(v||d3.extent(w[0].values.map(a).concat(l))).range(g||[S,0]),s.domain()[0]===s.domain()[1]&&(s.domain()[0]?s.domain([s.domain()[0]-s.domain()[0]*.01,s.domain()[1]+s.domain()[1]*.01]):s.domain([-1,1])),o.domain()[0]===o.domain()[1]&&(o.domain()[0]?o.domain([o.domain()[0]+o.domain()[0]*.01,o.domain()[1]-o.domain()[1]*.01]):o.domain([-1,1]));var N=T.selectAll("g.nv-wrap.nv-historicalBar-"+i).data([w[0].values]),C=N.enter().append("g").attr("class","nvd3 nv-wrap nv-historicalBar-"+i),k=C.append("defs"),L=C.append("g"),A=N.select("g");L.append("g").attr("class","nv-bars"),N.attr("transform","translate("+t.left+","+t.top+")"),T.on("click",function(e,t){y.chartClick({data:e,index:t,pos:d3.event,id:i})}),k.append("clipPath").attr("id","nv-chart-clip-path-"+i).append("rect"),N.select("#nv-chart-clip-path-"+i+" rect").attr("width",E).attr("height",S),A.attr("clip-path",h?"url(#nv-chart-clip-path-"+i+")":"");var O=N.select(".nv-bars").selectAll(".nv-bar").data(function(e){return e},function(e,t){return u(e,t)});O.exit().remove();var M=O.enter().append("rect").attr("x",0).attr("y",function(t,n){return e.utils.NaNtoZero(o(Math.max(0,a(t,n))))}).attr("height",function(t,n){return e.utils.NaNtoZero(Math.abs(o(a(t,n))-o(0)))}).attr("transform",function(e,t){return"translate("+(s(u(e,t))-E/w[0].values.length*.45)+",0)"}).on("mouseover",function(e,t){if(!b)return;d3.select(this).classed("hover",!0),y.elementMouseover({point:e,series:w[0],pos:[s(u(e,t)),o(a(e,t))],pointIndex:t,seriesIndex:0,e:d3.event})}).on("mouseout",function(e,t){if(!b)return;d3.select(this).classed("hover",!1),y.elementMouseout({point:e,series:w[0],pointIndex:t,seriesIndex:0,e:d3.event})}).on("click",function(e,t){if(!b)return;y.elementClick({value:a(e,t),data:e,index:t,pos:[s(u(e,t)),o(a(e,t))],e:d3.event,id:i}),d3.event.stopPropagation()}).on("dblclick",function(e,t){if(!b)return;y.elementDblClick({value:a(e,t),data:e,index:t,pos:[s(u(e,t)),o(a(e,t))],e:d3.event,id:i}),d3.event.stopPropagation()});O.attr("fill",function(e,t){return p(e,t)}).attr("class",function(e,t,n){return(a(e,t)<0?"nv-bar negative":"nv-bar positive")+" nv-bar-"+n+"-"+t}).transition().attr("transform",function(e,t){return"translate("+(s(u(e,t))-E/w[0].values.length*.45)+",0)"}).attr("width",E/w[0].values.length*.9),O.transition().attr("y",function(t,n){var r=a(t,n)<0?o(0):o(0)-o(a(t,n))<1?o(0)-1:o(a(t,n));return e.utils.NaNtoZero(r)}).attr("height",function(t,n){return e.utils.NaNtoZero(Math.max(Math.abs(o(a(t,n))-o(0)),1))})}),w}var t={top:0,right:0,bottom:0,left:0},n=960,r=500,i=Math.floor(Math.random()*1e4),s=d3.scale.linear(),o=d3.scale.linear(),u=function(e){return e.x},a=function(e){return e.y},f=[],l=[0],c=!1,h=!0,p=e.utils.defaultColor(),d,v,m,g,y=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout"),b=!0;return w.highlightPoint=function(e,t){d3.select(".nv-historicalBar-"+i).select(".nv-bars .nv-bar-0-"+e).classed("hover",t)},w.clearHighlights=function(){d3.select(".nv-historicalBar-"+i).select(".nv-bars .nv-bar.hover").classed("hover",!1)},w.dispatch=y,w.options=e.utils.optionsFunc.bind(w),w.x=function(e){return arguments.length?(u=e,w):u},w.y=function(e){return arguments.length?(a=e,w):a},w.margin=function(e){return arguments.length?(t.top=typeof e.top!="undefined"?e.top:t.top,t.right=typeof e.right!="undefined"?e.right:t.right,t.bottom=typeof e.bottom!="undefined"?e.bottom:t.bottom,t.left=typeof e.left!="undefined"?e.left:t.left,w):t},w.width=function(e){return arguments.length?(n=e,w):n},w.height=function(e){return arguments.length?(r=e,w):r},w.xScale=function(e){return arguments.length?(s=e,w):s},w.yScale=function(e){return arguments.length?(o=e,w):o},w.xDomain=function(e){return arguments.length?(d=e,w):d},w.yDomain=function(e){return arguments.length?(v=e,w):v},w.xRange=function(e){return arguments.length?(m=e,w):m},w.yRange=function(e){return arguments.length?(g=e,w):g},w.forceX=function(e){return arguments.length?(f=e,w):f},w.forceY=function(e){return arguments.length?(l=e,w):l},w.padData=function(e){return arguments.length?(c=e,w):c},w.clipEdge=function(e){return arguments.length?(h=e,w):h},w.color=function(t){return arguments.length?(p=e.utils.getColor(t),w):p},w.id=function(e){return arguments.length?(i=e,w):i},w.interactive=function(e){return arguments.length?(b=!1,w):b},w},e.models.historicalBarChart=function(){"use strict";function x(e){return e.each(function(d){var T=d3.select(this),N=this,C=(u||parseInt(T.style("width"))||960)-s.left-s.right,k=(a||parseInt(T.style("height"))||400)-s.top-s.bottom;x.update=function(){T.transition().duration(E).call(x)},x.container=this,g.disabled=d.map(function(e){return!!e.disabled});if(!y){var L;y={};for(L in g)g[L]instanceof Array?y[L]=g[L].slice(0):y[L]=g[L]}if(!d||!d.length||!d.filter(function(e){return e.values.length}).length){var A=T.selectAll(".nv-noData").data([b]);return A.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),A.attr("x",s.left+C/2).attr("y",s.top+k/2).text(function(e){return e}),x}T.selectAll(".nv-noData").remove(),v=t.xScale(),m=t.yScale();var O=T.selectAll("g.nv-wrap.nv-historicalBarChart").data([d]),M=O.enter().append("g").attr("class","nvd3 nv-wrap nv-historicalBarChart").append("g"),_=O.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-barsWrap"),M.append("g").attr("class","nv-legendWrap"),f&&(i.width(C),_.select(".nv-legendWrap").datum(d).call(i),s.top!=i.height()&&(s.top=i.height(),k=(a||parseInt(T.style("height"))||400)-s.top-s.bottom),O.select(".nv-legendWrap").attr("transform","translate(0,"+ -s.top+")")),O.attr("transform","translate("+s.left+","+s.top+")"),h&&_.select(".nv-y.nv-axis").attr("transform","translate("+C+",0)"),t.width(C).height(k).color(d.map(function(e,t){return e.color||o(e,t)}).filter(function(e,t){return!d[t].disabled}));var D=_.select(".nv-barsWrap").datum(d.filter(function(e){return!e.disabled}));D.transition().call(t),l&&(n.scale(v).tickSize(-k,0),_.select(".nv-x.nv-axis").attr("transform","translate(0,"+m.range()[0]+")"),_.select(".nv-x.nv-axis").transition().call(n)),c&&(r.scale(m).ticks(k/36).tickSize(-C,0),_.select(".nv-y.nv-axis").transition().call(r)),i.dispatch.on("legendClick",function(t,n){t.disabled=!t.disabled,d.filter(function(e){return!e.disabled}).length||d.map(function(e){return e.disabled=!1,O.selectAll(".nv-series").classed("disabled",!1),e}),g.disabled=d.map(function(e){return!!e.disabled}),w.stateChange(g),e.transition().call(x)}),i.dispatch.on("legendDblclick",function(e){d.forEach(function(e){e.disabled=!0}),e.disabled=!1,g.disabled=d.map(function(e){return!!e.disabled}),w.stateChange(g),x.update()}),w.on("tooltipShow",function(e){p&&S(e,N.parentNode)}),w.on("changeState",function(t){typeof t.disabled!="undefined"&&(d.forEach(function(e,n){e.disabled=t.disabled[n]}),g.disabled=t.disabled),e.call(x)})}),x}var t=e.models.historicalBar(),n=e.models.axis(),r=e.models.axis(),i=e.models.legend(),s={top:30,right:90,bottom:50,left:90},o=e.utils.defaultColor(),u=null,a=null,f=!1,l=!0,c=!0,h=!1,p=!0,d=function(e,t,n,r,i){return"

"+e+"

"+"

"+n+" at "+t+"

"},v,m,g={},y=null,b="No Data Available.",w=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),E=250;n.orient("bottom").tickPadding(7),r.orient(h?"right":"left");var S=function(i,s){if(s){var o=d3.select(s).select("svg"),u=o.node()?o.attr("viewBox"):null;if(u){u=u.split(" ");var a=parseInt(o.style("width"))/u[2];i.pos[0]=i.pos[0]*a,i.pos[1]=i.pos[1]*a}}var f=i.pos[0]+(s.offsetLeft||0),l=i.pos[1]+(s.offsetTop||0),c=n.tickFormat()(t.x()(i.point,i.pointIndex)),h=r.tickFormat()(t.y()(i.point,i.pointIndex)),p=d(i.series.key,c,h,i,x);e.tooltip.show([f,l],p,null,null,s)};return t.dispatch.on("elementMouseover.tooltip",function(e){e.pos=[e.pos[0]+s.left,e.pos[1]+s.top],w.tooltipShow(e)}),t.dispatch.on("elementMouseout.tooltip",function(e){w.tooltipHide(e)}),w.on("tooltipHide",function(){p&&e.tooltip.cleanup()}),x.dispatch=w,x.bars=t,x.legend=i,x.xAxis=n,x.yAxis=r,d3.rebind(x,t,"defined","isArea","x","y","size","xScale","yScale","xDomain","yDomain","xRange","yRange","forceX","forceY","interactive","clipEdge","clipVoronoi","id","interpolate","highlightPoint","clearHighlights","interactive"),x.options=e.utils.optionsFunc.bind(x),x.margin=function(e){return arguments.length?(s.top=typeof e.top!="undefined"?e.top:s.top,s.right=typeof e.right!="undefined"?e.right:s.right,s.bottom=typeof e.bottom!="undefined"?e.bottom:s.bottom,s.left=typeof e.left!="undefined"?e.left:s.left,x):s},x.width=function(e){return arguments.length?(u=e,x):u},x.height=function(e){return arguments.length?(a=e,x):a},x.color=function(t){return arguments.length?(o=e.utils.getColor(t),i.color(o),x):o},x.showLegend=function(e){return arguments.length?(f=e,x):f},x.showXAxis=function(e){return arguments.length?(l=e,x):l},x.showYAxis=function(e){return arguments.length?(c=e,x):c},x.rightAlignYAxis=function(e){return arguments.length?(h=e,r.orient(e?"right":"left"),x):h},x.tooltips=function(e){return arguments.length?(p=e,x):p},x.tooltipContent=function(e){return arguments.length?(d=e,x):d},x.state=function(e){return arguments.length?(g=e,x):g},x.defaultState=function(e){return arguments.length?(y=e,x):y},x.noData=function(e){return arguments.length?(b=e,x):b},x.transitionDuration=function(e){return arguments.length?(E=e,x):E},x},e.models.indentedTree=function(){"use strict";function g(e){return e.each(function(e){function k(e,t,n){d3.event.stopPropagation();if(d3.event.shiftKey&&!n)return d3.event.shiftKey=!1,e.values&&e.values.forEach(function(e){(e.values||e._values)&&k(e,0,!0)}),!0;if(!O(e))return!0;e.values?(e._values=e.values,e.values=null):(e.values=e._values,e._values=null),g.update()}function L(e){return e._values&&e._values.length?h:e.values&&e.values.length?p:""}function A(e){return e._values&&e._values.length}function O(e){var t=e.values||e._values;return t&&t.length}var t=1,n=d3.select(this),i=d3.layout.tree().children(function(e){return e.values}).size([r,f]);g.update=function(){n.transition().duration(600).call(g)},e[0]||(e[0]={key:a});var s=i.nodes(e[0]),y=d3.select(this).selectAll("div").data([[s]]),b=y.enter().append("div").attr("class","nvd3 nv-wrap nv-indentedtree"),w=b.append("table"),E=y.select("table").attr("width","100%").attr("class",c);if(o){var S=w.append("thead"),x=S.append("tr");l.forEach(function(e){x.append("th").attr("width",e.width?e.width:"10%").style("text-align",e.type=="numeric"?"right":"left").append("span").text(e.label)})}var T=E.selectAll("tbody").data(function(e){return e});T.enter().append("tbody"),t=d3.max(s,function(e){return e.depth}),i.size([r,t*f]);var N=T.selectAll("tr").data(function(e){return e.filter(function(e){return u&&!e.children?u(e):!0})},function(e,t){return e.id||e.id||++m});N.exit().remove(),N.select("img.nv-treeicon").attr("src",L).classed("folded",A);var C=N.enter().append("tr");l.forEach(function(e,t){var n=C.append("td").style("padding-left",function(e){return(t?0:e.depth*f+12+(L(e)?0:16))+"px"},"important").style("text-align",e.type=="numeric"?"right":"left");t==0&&n.append("img").classed("nv-treeicon",!0).classed("nv-folded",A).attr("src",L).style("width","14px").style("height","14px").style("padding","0 1px").style("display",function(e){return L(e)?"inline-block":"none"}).on("click",k),n.each(function(n){!t&&v(n)?d3.select(this).append("a").attr("href",v).attr("class",d3.functor(e.classes)).append("span"):d3.select(this).append("span"),d3.select(this).select("span").attr("class",d3.functor(e.classes)).text(function(t){return e.format?e.format(t):t[e.key]||"-"})}),e.showCount&&(n.append("span").attr("class","nv-childrenCount"),N.selectAll("span.nv-childrenCount").text(function(e){return e.values&&e.values.length||e._values&&e._values.length?"("+(e.values&&e.values.filter(function(e){return u?u(e):!0}).length||e._values&&e._values.filter(function(e){return u?u(e):!0}).length||0)+")":""}))}),N.order().on("click",function(e){d.elementClick({row:this,data:e,pos:[e.x,e.y]})}).on("dblclick",function(e){d.elementDblclick({row:this,data:e,pos:[e.x,e.y]})}).on("mouseover",function(e){d.elementMouseover({row:this,data:e,pos:[e.x,e.y]})}).on("mouseout",function(e){d.elementMouseout({row:this,data:e,pos:[e.x,e.y]})})}),g}var t={top:0,right:0,bottom:0,left:0},n=960,r=500,i=e.utils.defaultColor(),s=Math.floor(Math.random()*1e4),o=!0,u=!1,a="No Data Available.",f=20,l=[{key:"key",label:"Name",type:"text"}],c=null,h="images/grey-plus.png",p="images/grey-minus.png",d=d3.dispatch("elementClick","elementDblclick","elementMouseover","elementMouseout"),v=function(e){return e.url},m=0;return g.options=e.utils.optionsFunc.bind(g),g.margin=function(e){return arguments.length?(t.top=typeof e.top!="undefined"?e.top:t.top,t.right=typeof e.right!="undefined"?e.right:t.right,t.bottom=typeof e.bottom!="undefined"?e.bottom:t.bottom,t.left=typeof e.left!="undefined"?e.left:t.left,g):t},g.width=function(e){return arguments.length?(n=e,g):n},g.height=function(e){return arguments.length?(r=e,g):r},g.color=function(t){return arguments.length?(i=e.utils.getColor(t),scatter.color(i),g):i},g.id=function(e){return arguments.length?(s=e,g):s},g.header=function(e){return arguments.length?(o=e,g):o},g.noData=function(e){return arguments.length?(a=e,g):a},g.filterZero=function(e){return arguments.length?(u=e,g):u},g.columns=function(e){return arguments.length?(l=e,g):l},g.tableClass=function(e){return arguments.length?(c=e,g):c},g.iconOpen=function(e){return arguments.length?(h=e,g):h},g.iconClose=function(e){return arguments.length?(p=e,g):p},g.getUrl=function(e){return arguments.length?(v=e,g):v},g},e.models.legend=function(){"use strict";function c(h){return h.each(function(c){var h=n-t.left-t.right,p=d3.select(this),d=p.selectAll("g.nv-legend").data([c]),v=d.enter().append("g").attr("class","nvd3 nv-legend").append("g"),m=d.select("g");d.attr("transform","translate("+t.left+","+t.top+")");var g=m.selectAll(".nv-series").data(function(e){return e}),y=g.enter().append("g").attr("class","nv-series").on("mouseover",function(e,t){l.legendMouseover(e,t)}).on("mouseout",function(e,t){l.legendMouseout(e,t)}).on("click",function(e,t){l.legendClick(e,t),a&&(f?(c.forEach(function(e){e.disabled=!0}),e.disabled=!1):(e.disabled=!e.disabled,c.every(function(e){return e.disabled})&&c.forEach(function(e){e.disabled=!1})),l.stateChange({disabled:c.map(function(e){return!!e.disabled})}))}).on("dblclick",function(e,t){l.legendDblclick(e,t),a&&(c.forEach(function(e){e.disabled=!0}),e.disabled=!1,l.stateChange({disabled:c.map(function(e){return!!e.disabled})}))});y.append("circle").style("stroke-width",2).attr("class","nv-legend-symbol").attr("r",5),y.append("text").attr("text-anchor","start").attr("class","nv-legend-text").attr("dy",".32em").attr("dx","8"),g.classed("disabled",function(e){return e.disabled}),g.exit().remove(),g.select("circle").style("fill",function(e,t){return e.color||s(e,t)}).style("stroke",function(e,t){return e.color||s(e,t)}),g.select("text").text(i);if(o){var b=[];g.each(function(t,n){var r=d3.select(this).select("text"),i;try{i=r.node().getComputedTextLength()}catch(s){i=e.utils.calcApproxTextWidth(r)}b.push(i+28)});var w=0,E=0,S=[];while(Eh&&w>1){S=[],w--;for(var x=0;x(S[x%w]||0)&&(S[x%w]=b[x]);E=S.reduce(function(e,t,n,r){return e+t})}var T=[];for(var N=0,C=0;NA&&(A=L),"translate("+O+","+k+")"}),m.attr("transform","translate("+(n-t.right-A)+","+t.top+")"),r=t.top+t.bottom+k+15}}),c}var t={top:5,right:0,bottom:5,left:0},n=400,r=20,i=function(e){return e.key},s=e.utils.defaultColor(),o=!0,u=!0,a=!0,f=!1,l=d3.dispatch("legendClick","legendDblclick","legendMouseover","legendMouseout","stateChange");return c.dispatch=l,c.options=e.utils.optionsFunc.bind(c),c.margin=function(e){return arguments.length?(t.top=typeof e.top!="undefined"?e.top:t.top,t.right=typeof e.right!="undefined"?e.right:t.right,t.bottom=typeof e.bottom!="undefined"?e.bottom:t.bottom,t.left=typeof e.left!="undefined"?e.left:t.left,c):t},c.width=function(e){return arguments.length?(n=e,c):n},c.height=function(e){return arguments.length?(r=e,c):r},c.key=function(e){return arguments.length?(i=e,c):i},c.color=function(t){return arguments.length?(s=e.utils.getColor(t),c):s},c.align=function(e){return arguments.length?(o=e,c):o},c.rightAlign=function(e){return arguments.length?(u=e,c):u},c.updateState=function(e){return arguments.length?(a=e,c):a},c.radioButtonMode=function(e){return arguments.length?(f=e,c):f},c},e.models.line=function(){"use strict";function m(g){return g.each(function(m){var g=r-n.left-n.right,b=i-n.top-n.bottom,w=d3.select(this);c=t.xScale(),h=t.yScale(),d=d||c,v=v||h;var E=w.selectAll("g.nv-wrap.nv-line").data([m]),S=E.enter().append("g").attr("class","nvd3 nv-wrap nv-line"),T=S.append("defs"),N=S.append("g"),C=E.select("g");N.append("g").attr("class","nv-groups"),N.append("g").attr("class","nv-scatterWrap"),E.attr("transform","translate("+n.left+","+n.top+")"),t.width(g).height(b);var k=E.select(".nv-scatterWrap");k.transition().call(t),T.append("clipPath").attr("id","nv-edge-clip-"+t.id()).append("rect"),E.select("#nv-edge-clip-"+t.id()+" rect").attr("width",g).attr("height",b),C.attr("clip-path",l?"url(#nv-edge-clip-"+t.id()+")":""),k.attr("clip-path",l?"url(#nv-edge-clip-"+t.id()+")":"");var L=E.select(".nv-groups").selectAll(".nv-group").data(function(e){return e},function(e){return e.key});L.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),L.exit().transition().style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove(),L.attr("class",function(e,t){return"nv-group nv-series-"+t}).classed("hover",function(e){return e.hover}).style("fill",function(e,t){return s(e,t)}).style("stroke",function(e,t){return s(e,t)}),L.transition().style("stroke-opacity",1).style("fill-opacity",.5);var A=L.selectAll("path.nv-area").data(function(e){return f(e)?[e]:[]});A.enter().append("path").attr("class","nv-area").attr("d",function(t){return d3.svg.area().interpolate(p).defined(a).x(function(t,n){return e.utils.NaNtoZero(d(o(t,n)))}).y0(function(t,n){return e.utils.NaNtoZero(v(u(t,n)))}).y1(function(e,t){return v(h.domain()[0]<=0?h.domain()[1]>=0?0:h.domain()[1]:h.domain()[0])}).apply(this,[t.values])}),L.exit().selectAll("path.nv-area").remove(),A.transition().attr("d",function(t){return d3.svg.area().interpolate(p).defined(a).x(function(t,n){return e.utils.NaNtoZero(c(o(t,n)))}).y0(function(t,n){return e.utils.NaNtoZero(h(u(t,n)))}).y1(function(e,t){return h(h.domain()[0]<=0?h.domain()[1]>=0?0:h.domain()[1]:h.domain()[0])}).apply(this,[t.values])});var O=L.selectAll("path.nv-line").data(function(e){return[e.values]});O.enter().append("path").attr("class","nv-line").attr("d",d3.svg.line().interpolate(p).defined(a).x(function(t,n){return e.utils.NaNtoZero(d(o(t,n)))}).y(function(t,n){return e.utils.NaNtoZero(v(u(t,n)))})),L.exit().selectAll("path.nv-line").transition().attr("d",d3.svg.line().interpolate(p).defined(a).x(function(t,n){return e.utils.NaNtoZero(c(o(t,n)))}).y(function(t,n){return e.utils.NaNtoZero(h(u(t,n)))})),O.transition().attr("d",d3.svg.line().interpolate(p).defined(a).x(function(t,n){return e.utils.NaNtoZero(c(o(t,n)))}).y(function(t,n){return e.utils.NaNtoZero(h(u(t,n)))})),d=c.copy(),v=h.copy()}),m}var t=e.models.scatter(),n={top:0,right:0,bottom:0,left:0},r=960,i=500,s=e.utils.defaultColor(),o=function(e){return e.x},u=function(e){return e.y},a=function(e,t){return!isNaN(u(e,t))&&u(e,t)!==null},f=function(e){return e.area},l=!1,c,h,p="linear" -;t.size(16).sizeDomain([16,256]);var d,v;return m.dispatch=t.dispatch,m.scatter=t,d3.rebind(m,t,"id","interactive","size","xScale","yScale","zScale","xDomain","yDomain","xRange","yRange","sizeDomain","forceX","forceY","forceSize","clipVoronoi","useVoronoi","clipRadius","padData","highlightPoint","clearHighlights"),m.options=e.utils.optionsFunc.bind(m),m.margin=function(e){return arguments.length?(n.top=typeof e.top!="undefined"?e.top:n.top,n.right=typeof e.right!="undefined"?e.right:n.right,n.bottom=typeof e.bottom!="undefined"?e.bottom:n.bottom,n.left=typeof e.left!="undefined"?e.left:n.left,m):n},m.width=function(e){return arguments.length?(r=e,m):r},m.height=function(e){return arguments.length?(i=e,m):i},m.x=function(e){return arguments.length?(o=e,t.x(e),m):o},m.y=function(e){return arguments.length?(u=e,t.y(e),m):u},m.clipEdge=function(e){return arguments.length?(l=e,m):l},m.color=function(n){return arguments.length?(s=e.utils.getColor(n),t.color(s),m):s},m.interpolate=function(e){return arguments.length?(p=e,m):p},m.defined=function(e){return arguments.length?(a=e,m):a},m.isArea=function(e){return arguments.length?(f=d3.functor(e),m):f},m},e.models.lineChart=function(){"use strict";function N(m){return m.each(function(m){var C=d3.select(this),k=this,L=(a||parseInt(C.style("width"))||960)-o.left-o.right,A=(f||parseInt(C.style("height"))||400)-o.top-o.bottom;N.update=function(){C.transition().duration(x).call(N)},N.container=this,b.disabled=m.map(function(e){return!!e.disabled});if(!w){var O;w={};for(O in b)b[O]instanceof Array?w[O]=b[O].slice(0):w[O]=b[O]}if(!m||!m.length||!m.filter(function(e){return e.values.length}).length){var M=C.selectAll(".nv-noData").data([E]);return M.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),M.attr("x",o.left+L/2).attr("y",o.top+A/2).text(function(e){return e}),N}C.selectAll(".nv-noData").remove(),g=t.xScale(),y=t.yScale();var _=C.selectAll("g.nv-wrap.nv-lineChart").data([m]),D=_.enter().append("g").attr("class","nvd3 nv-wrap nv-lineChart").append("g"),P=_.select("g");D.append("rect").style("opacity",0),D.append("g").attr("class","nv-x nv-axis"),D.append("g").attr("class","nv-y nv-axis"),D.append("g").attr("class","nv-linesWrap"),D.append("g").attr("class","nv-legendWrap"),D.append("g").attr("class","nv-interactive"),P.select("rect").attr("width",L).attr("height",A),l&&(i.width(L),P.select(".nv-legendWrap").datum(m).call(i),o.top!=i.height()&&(o.top=i.height(),A=(f||parseInt(C.style("height"))||400)-o.top-o.bottom),_.select(".nv-legendWrap").attr("transform","translate(0,"+ -o.top+")")),_.attr("transform","translate("+o.left+","+o.top+")"),p&&P.select(".nv-y.nv-axis").attr("transform","translate("+L+",0)"),d&&(s.width(L).height(A).margin({left:o.left,top:o.top}).svgContainer(C).xScale(g),_.select(".nv-interactive").call(s)),t.width(L).height(A).color(m.map(function(e,t){return e.color||u(e,t)}).filter(function(e,t){return!m[t].disabled}));var H=P.select(".nv-linesWrap").datum(m.filter(function(e){return!e.disabled}));H.transition().call(t),c&&(n.scale(g).ticks(L/100).tickSize(-A,0),P.select(".nv-x.nv-axis").attr("transform","translate(0,"+y.range()[0]+")"),P.select(".nv-x.nv-axis").transition().call(n)),h&&(r.scale(y).ticks(A/36).tickSize(-L,0),P.select(".nv-y.nv-axis").transition().call(r)),i.dispatch.on("stateChange",function(e){b=e,S.stateChange(b),N.update()}),s.dispatch.on("elementMousemove",function(i){t.clearHighlights();var a,f,l,c=[];m.filter(function(e,t){return e.seriesIndex=t,!e.disabled}).forEach(function(n,r){f=e.interactiveBisect(n.values,i.pointXValue,N.x()),t.highlightPoint(r,f,!0);var s=n.values[f];if(typeof s=="undefined")return;typeof a=="undefined"&&(a=s),typeof l=="undefined"&&(l=N.xScale()(N.x()(s,f))),c.push({key:n.key,value:N.y()(s,f),color:u(n,n.seriesIndex)})});var h=n.tickFormat()(N.x()(a,f));s.tooltip.position({left:l+o.left,top:i.mouseY+o.top}).chartContainer(k.parentNode).enabled(v).valueFormatter(function(e,t){return r.tickFormat()(e)}).data({value:h,series:c})(),s.renderGuideLine(l)}),s.dispatch.on("elementMouseout",function(e){S.tooltipHide(),t.clearHighlights()}),S.on("tooltipShow",function(e){v&&T(e,k.parentNode)}),S.on("changeState",function(e){typeof e.disabled!="undefined"&&(m.forEach(function(t,n){t.disabled=e.disabled[n]}),b.disabled=e.disabled),N.update()})}),N}var t=e.models.line(),n=e.models.axis(),r=e.models.axis(),i=e.models.legend(),s=e.interactiveGuideline(),o={top:30,right:20,bottom:50,left:60},u=e.utils.defaultColor(),a=null,f=null,l=!0,c=!0,h=!0,p=!1,d=!1,v=!0,m=function(e,t,n,r,i){return"

"+e+"

"+"

"+n+" at "+t+"

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

"+e+"

"+"

"+n+" at "+t+"

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

"+e+"

"+"

"+n+" at "+t+"

"},x="No Data Available.",T=d3.dispatch("tooltipShow","tooltipHide","brush"),N=250;t.clipEdge(!0),n.interactive(!1),r.orient("bottom").tickPadding(5),i.orient("left"),s.orient("bottom").tickPadding(5),o.orient("left");var C=function(n,s){var o=n.pos[0]+(s.offsetLeft||0),u=n.pos[1]+(s.offsetTop||0),a=r.tickFormat()(t.x()(n.point,n.pointIndex)),f=i.tickFormat()(t.y()(n.point,n.pointIndex)),l=S(n.series.key,a,f,n,k);e.tooltip.show([o,u],l,null,null,s)};return t.dispatch.on("elementMouseover.tooltip",function(e){e.pos=[e.pos[0]+f.left,e.pos[1]+f.top],T.tooltipShow(e)}),t.dispatch.on("elementMouseout.tooltip",function(e){T.tooltipHide(e)}),T.on("tooltipHide",function(){E&&e.tooltip.cleanup()}),k.dispatch=T,k.legend=u,k.lines=t,k.lines2=n,k.xAxis=r,k.yAxis=i,k.x2Axis=s,k.y2Axis=o,d3.rebind(k,t,"defined","isArea","size","xDomain","yDomain","xRange","yRange","forceX","forceY","interactive","clipEdge","clipVoronoi","id"),k.options=e.utils.optionsFunc.bind(k),k.x=function(e){return arguments.length?(t.x(e),n.x(e),k):t.x},k.y=function(e){return arguments.length?(t.y(e),n.y(e),k):t.y},k.margin=function(e){return arguments.length?(f.top=typeof e.top!="undefined"?e.top:f.top,f.right=typeof e.right!="undefined"?e.right:f.right,f.bottom=typeof e.bottom!="undefined"?e.bottom:f.bottom,f.left=typeof e.left!="undefined"?e.left:f.left,k):f},k.margin2=function(e){return arguments.length?(l=e,k):l},k.width=function(e){return arguments.length?(h=e,k):h},k.height=function(e){return arguments.length?(p=e,k):p},k.height2=function(e){return arguments.length?(d=e,k):d},k.color=function(t){return arguments.length?(c=e.utils.getColor(t),u.color(c),k):c},k.showLegend=function(e){return arguments.length?(b=e,k):b},k.tooltips=function(e){return arguments.length?(E=e,k):E},k.tooltipContent=function(e){return arguments.length?(S=e,k):S},k.interpolate=function(e){return arguments.length?(t.interpolate(e),n.interpolate(e),k):t.interpolate()},k.noData=function(e){return arguments.length?(x=e,k):x},k.xTickFormat=function(e){return arguments.length?(r.tickFormat(e),s.tickFormat(e),k):r.tickFormat()},k.yTickFormat=function(e){return arguments.length?(i.tickFormat(e),o.tickFormat(e),k):i.tickFormat()},k.brushExtent=function(e){return arguments.length?(w=e,k):w},k.transitionDuration=function(e){return arguments.length?(N=e,k):N},k},e.models.linePlusBarWithFocusChart=function(){"use strict";function B(e){return e.each(function(e){function nt(e){var t=+(e=="e"),n=t?1:-1,r=q/3;return"M"+.5*n+","+r+"A6,6 0 0 "+t+" "+6.5*n+","+(r+6)+"V"+(2*r-6)+"A6,6 0 0 "+t+" "+.5*n+","+2*r+"Z"+"M"+2.5*n+","+(r+8)+"V"+(2*r-8)+"M"+4.5*n+","+(r+8)+"V"+(2*r-8)}function rt(){h.empty()||h.extent(x),Z.data([h.empty()?k.domain():x]).each(function(e,t){var n=k(e[0])-k.range()[0],r=k.range()[1]-k(e[1]);d3.select(this).select(".left").attr("width",n<0?0:n),d3.select(this).select(".right").attr("x",k(e[1])).attr("width",r<0?0:r)})}function it(){x=h.empty()?null:h.extent(),S=h.empty()?k.domain():h.extent(),D.brush({extent:S,brush:h}),rt(),r.width(F).height(I).color(e.map(function(e,t){return e.color||w(e,t)}).filter(function(t,n){return!e[n].disabled&&e[n].bar})),t.width(F).height(I).color(e.map(function(e,t){return e.color||w(e,t)}).filter(function(t,n){return!e[n].disabled&&!e[n].bar}));var n=J.select(".nv-focus .nv-barsWrap").datum(U.length?U.map(function(e,t){return{key:e.key,values:e.values.filter(function(e,t){return r.x()(e,t)>=S[0]&&r.x()(e,t)<=S[1]})}}):[{values:[]}]),i=J.select(".nv-focus .nv-linesWrap").datum(z[0].disabled?[{values:[]}]:z.map(function(e,n){return{key:e.key,values:e.values.filter(function(e,n){return t.x()(e,n)>=S[0]&&t.x()(e,n)<=S[1]})}}));U.length?C=r.xScale():C=t.xScale(),s.scale(C).ticks(F/100).tickSize(-I,0),s.domain([Math.ceil(S[0]),Math.floor(S[1])]),J.select(".nv-x.nv-axis").transition().duration(P).call(s),n.transition().duration(P).call(r),i.transition().duration(P).call(t),J.select(".nv-focus .nv-x.nv-axis").attr("transform","translate(0,"+L.range()[0]+")"),u.scale(L).ticks(I/36).tickSize(-F,0),J.select(".nv-focus .nv-y1.nv-axis").style("opacity",U.length?1:0),a.scale(A).ticks(I/36).tickSize(U.length?0:-F,0),J.select(".nv-focus .nv-y2.nv-axis").style("opacity",z.length?1:0).attr("transform","translate("+C.range()[1]+",0)"),J.select(".nv-focus .nv-y1.nv-axis").transition().duration(P).call(u),J.select(".nv-focus .nv-y2.nv-axis").transition().duration(P).call(a)}var N=d3.select(this),j=this,F=(v||parseInt(N.style("width"))||960)-p.left-p.right,I=(m||parseInt(N.style("height"))||400)-p.top-p.bottom-g,q=g-d.top-d.bottom;B.update=function(){N.transition().duration(P).call(B)},B.container=this;if(!e||!e.length||!e.filter(function(e){return e.values.length}).length){var R=N.selectAll(".nv-noData").data([_]);return R.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),R.attr("x",p.left+F/2).attr("y",p.top+I/2).text(function(e){return e}),B}N.selectAll(".nv-noData").remove();var U=e.filter(function(e){return!e.disabled&&e.bar}),z=e.filter(function(e){return!e.bar});C=r.xScale(),k=o.scale(),L=r.yScale(),A=t.yScale(),O=i.yScale(),M=n.yScale();var W=e.filter(function(e){return!e.disabled&&e.bar}).map(function(e){return e.values.map(function(e,t){return{x:y(e,t),y:b(e,t)}})}),X=e.filter(function(e){return!e.disabled&&!e.bar}).map(function(e){return e.values.map(function(e,t){return{x:y(e,t),y:b(e,t)}})});C.range([0,F]),k.domain(d3.extent(d3.merge(W.concat(X)),function(e){return e.x})).range([0,F]);var V=N.selectAll("g.nv-wrap.nv-linePlusBar").data([e]),$=V.enter().append("g").attr("class","nvd3 nv-wrap nv-linePlusBar").append("g"),J=V.select("g");$.append("g").attr("class","nv-legendWrap");var K=$.append("g").attr("class","nv-focus");K.append("g").attr("class","nv-x nv-axis"),K.append("g").attr("class","nv-y1 nv-axis"),K.append("g").attr("class","nv-y2 nv-axis"),K.append("g").attr("class","nv-barsWrap"),K.append("g").attr("class","nv-linesWrap");var Q=$.append("g").attr("class","nv-context");Q.append("g").attr("class","nv-x nv-axis"),Q.append("g").attr("class","nv-y1 nv-axis"),Q.append("g").attr("class","nv-y2 nv-axis"),Q.append("g").attr("class","nv-barsWrap"),Q.append("g").attr("class","nv-linesWrap"),Q.append("g").attr("class","nv-brushBackground"),Q.append("g").attr("class","nv-x nv-brush"),E&&(c.width(F/2),J.select(".nv-legendWrap").datum(e.map(function(e){return e.originalKey=e.originalKey===undefined?e.key:e.originalKey,e.key=e.originalKey+(e.bar?" (left axis)":" (right axis)"),e})).call(c),p.top!=c.height()&&(p.top=c.height(),I=(m||parseInt(N.style("height"))||400)-p.top-p.bottom-g),J.select(".nv-legendWrap").attr("transform","translate("+F/2+","+ -p.top+")")),V.attr("transform","translate("+p.left+","+p.top+")"),i.width(F).height(q).color(e.map(function(e,t){return e.color||w(e,t)}).filter(function(t,n){return!e[n].disabled&&e[n].bar})),n.width(F).height(q).color(e.map(function(e,t){return e.color||w(e,t)}).filter(function(t,n){return!e[n].disabled&&!e[n].bar}));var G=J.select(".nv-context .nv-barsWrap").datum(U.length?U:[{values:[]}]),Y=J.select(".nv-context .nv-linesWrap").datum(z[0].disabled?[{values:[]}]:z);J.select(".nv-context").attr("transform","translate(0,"+(I+p.bottom+d.top)+")"),G.transition().call(i),Y.transition().call(n),h.x(k).on("brush",it),x&&h.extent(x);var Z=J.select(".nv-brushBackground").selectAll("g").data([x||h.extent()]),et=Z.enter().append("g");et.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",q),et.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",q);var tt=J.select(".nv-x.nv-brush").call(h);tt.selectAll("rect").attr("height",q),tt.selectAll(".resize").append("path").attr("d",nt),o.ticks(F/100).tickSize(-q,0),J.select(".nv-context .nv-x.nv-axis").attr("transform","translate(0,"+O.range()[0]+")"),J.select(".nv-context .nv-x.nv-axis").transition().call(o),f.scale(O).ticks(q/36).tickSize(-F,0),J.select(".nv-context .nv-y1.nv-axis").style("opacity",U.length?1:0).attr("transform","translate(0,"+k.range()[0]+")"),J.select(".nv-context .nv-y1.nv-axis").transition().call(f),l.scale(M).ticks(q/36).tickSize(U.length?0:-F,0),J.select(".nv-context .nv-y2.nv-axis").style("opacity",z.length?1:0).attr("transform","translate("+k.range()[1]+",0)"),J.select(".nv-context .nv-y2.nv-axis").transition().call(l),c.dispatch.on("stateChange",function(e){B.update()}),D.on("tooltipShow",function(e){T&&H(e,j.parentNode)}),it()}),B}var t=e.models.line(),n=e.models.line(),r=e.models.historicalBar(),i=e.models.historicalBar(),s=e.models.axis(),o=e.models.axis(),u=e.models.axis(),a=e.models.axis(),f=e.models.axis(),l=e.models.axis(),c=e.models.legend(),h=d3.svg.brush(),p={top:30,right:30,bottom:30,left:60},d={top:0,right:30,bottom:20,left:60},v=null,m=null,g=100,y=function(e){return e.x},b=function(e){return e.y},w=e.utils.defaultColor(),E=!0,S,x=null,T=!0,N=function(e,t,n,r,i){return"

"+e+"

"+"

"+n+" at "+t+"

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

"+e+"

"+"

"+n+" on "+t+"

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

"+e+" - "+t+"

"+"

"+n+"

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

"+e+"

"+"

"+n+" at "+t+"

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

"+e+"

"+"

"+t+"

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

"+e+"

"+"

"+r+"

"},k={},L=null,A=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState" -),O="No Data Available.",M=250;t.xScale(h).yScale(p),n.orient("bottom").tickPadding(10),r.orient(b?"right":"left").tickPadding(10),o.axis("x"),u.axis("y"),s.updateState(!1);var _,D,P=function(i,s){var o=i.pos[0]+(s.offsetLeft||0),u=i.pos[1]+(s.offsetTop||0),f=i.pos[0]+(s.offsetLeft||0),l=p.range()[0]+a.top+(s.offsetTop||0),c=h.range()[0]+a.left+(s.offsetLeft||0),d=i.pos[1]+(s.offsetTop||0),v=n.tickFormat()(t.x()(i.point,i.pointIndex)),m=r.tickFormat()(t.y()(i.point,i.pointIndex));T!=null&&e.tooltip.show([f,l],T(i.series.key,v,m,i,B),"n",1,s,"x-nvtooltip"),N!=null&&e.tooltip.show([c,d],N(i.series.key,v,m,i,B),"e",1,s,"y-nvtooltip"),C!=null&&e.tooltip.show([o,u],C(i.series.key,v,m,i.point.tooltip,i,B),i.value<0?"n":"s",null,s)},H=[{key:"Magnify",disabled:!0}];return t.dispatch.on("elementMouseout.tooltip",function(e){A.tooltipHide(e),d3.select(".nv-chart-"+t.id()+" .nv-series-"+e.seriesIndex+" .nv-distx-"+e.pointIndex).attr("y1",0),d3.select(".nv-chart-"+t.id()+" .nv-series-"+e.seriesIndex+" .nv-disty-"+e.pointIndex).attr("x2",u.size())}),A.on("tooltipHide",function(){x&&e.tooltip.cleanup()}),B.dispatch=A,B.scatter=t,B.legend=i,B.controls=s,B.xAxis=n,B.yAxis=r,B.distX=o,B.distY=u,d3.rebind(B,t,"id","interactive","pointActive","x","y","shape","size","xScale","yScale","zScale","xDomain","yDomain","xRange","yRange","sizeDomain","sizeRange","forceX","forceY","forceSize","clipVoronoi","clipRadius","useVoronoi"),B.options=e.utils.optionsFunc.bind(B),B.margin=function(e){return arguments.length?(a.top=typeof e.top!="undefined"?e.top:a.top,a.right=typeof e.right!="undefined"?e.right:a.right,a.bottom=typeof e.bottom!="undefined"?e.bottom:a.bottom,a.left=typeof e.left!="undefined"?e.left:a.left,B):a},B.width=function(e){return arguments.length?(f=e,B):f},B.height=function(e){return arguments.length?(l=e,B):l},B.color=function(t){return arguments.length?(c=e.utils.getColor(t),i.color(c),o.color(c),u.color(c),B):c},B.showDistX=function(e){return arguments.length?(d=e,B):d},B.showDistY=function(e){return arguments.length?(v=e,B):v},B.showControls=function(e){return arguments.length?(w=e,B):w},B.showLegend=function(e){return arguments.length?(m=e,B):m},B.showXAxis=function(e){return arguments.length?(g=e,B):g},B.showYAxis=function(e){return arguments.length?(y=e,B):y},B.rightAlignYAxis=function(e){return arguments.length?(b=e,r.orient(e?"right":"left"),B):b},B.fisheye=function(e){return arguments.length?(E=e,B):E},B.tooltips=function(e){return arguments.length?(x=e,B):x},B.tooltipContent=function(e){return arguments.length?(C=e,B):C},B.tooltipXContent=function(e){return arguments.length?(T=e,B):T},B.tooltipYContent=function(e){return arguments.length?(N=e,B):N},B.state=function(e){return arguments.length?(k=e,B):k},B.defaultState=function(e){return arguments.length?(L=e,B):L},B.noData=function(e){return arguments.length?(O=e,B):O},B.transitionDuration=function(e){return arguments.length?(M=e,B):M},B},e.models.sparkline=function(){"use strict";function d(e){return e.each(function(e){var i=n-t.left-t.right,d=r-t.top-t.bottom,v=d3.select(this);s.domain(l||d3.extent(e,u)).range(h||[0,i]),o.domain(c||d3.extent(e,a)).range(p||[d,0]);var m=v.selectAll("g.nv-wrap.nv-sparkline").data([e]),g=m.enter().append("g").attr("class","nvd3 nv-wrap nv-sparkline"),b=g.append("g"),w=m.select("g");m.attr("transform","translate("+t.left+","+t.top+")");var E=m.selectAll("path").data(function(e){return[e]});E.enter().append("path"),E.exit().remove(),E.style("stroke",function(e,t){return e.color||f(e,t)}).attr("d",d3.svg.line().x(function(e,t){return s(u(e,t))}).y(function(e,t){return o(a(e,t))}));var S=m.selectAll("circle.nv-point").data(function(e){function n(t){if(t!=-1){var n=e[t];return n.pointIndex=t,n}return null}var t=e.map(function(e,t){return a(e,t)}),r=n(t.lastIndexOf(o.domain()[1])),i=n(t.indexOf(o.domain()[0])),s=n(t.length-1);return[i,r,s].filter(function(e){return e!=null})});S.enter().append("circle"),S.exit().remove(),S.attr("cx",function(e,t){return s(u(e,e.pointIndex))}).attr("cy",function(e,t){return o(a(e,e.pointIndex))}).attr("r",2).attr("class",function(e,t){return u(e,e.pointIndex)==s.domain()[1]?"nv-point nv-currentValue":a(e,e.pointIndex)==o.domain()[0]?"nv-point nv-minValue":"nv-point nv-maxValue"})}),d}var t={top:2,right:0,bottom:2,left:0},n=400,r=32,i=!0,s=d3.scale.linear(),o=d3.scale.linear(),u=function(e){return e.x},a=function(e){return e.y},f=e.utils.getColor(["#000"]),l,c,h,p;return d.options=e.utils.optionsFunc.bind(d),d.margin=function(e){return arguments.length?(t.top=typeof e.top!="undefined"?e.top:t.top,t.right=typeof e.right!="undefined"?e.right:t.right,t.bottom=typeof e.bottom!="undefined"?e.bottom:t.bottom,t.left=typeof e.left!="undefined"?e.left:t.left,d):t},d.width=function(e){return arguments.length?(n=e,d):n},d.height=function(e){return arguments.length?(r=e,d):r},d.x=function(e){return arguments.length?(u=d3.functor(e),d):u},d.y=function(e){return arguments.length?(a=d3.functor(e),d):a},d.xScale=function(e){return arguments.length?(s=e,d):s},d.yScale=function(e){return arguments.length?(o=e,d):o},d.xDomain=function(e){return arguments.length?(l=e,d):l},d.yDomain=function(e){return arguments.length?(c=e,d):c},d.xRange=function(e){return arguments.length?(h=e,d):h},d.yRange=function(e){return arguments.length?(p=e,d):p},d.animate=function(e){return arguments.length?(i=e,d):i},d.color=function(t){return arguments.length?(f=e.utils.getColor(t),d):f},d},e.models.sparklinePlus=function(){"use strict";function v(e){return e.each(function(c){function O(){if(a)return;var e=C.selectAll(".nv-hoverValue").data(u),r=e.enter().append("g").attr("class","nv-hoverValue").style("stroke-opacity",0).style("fill-opacity",0);e.exit().transition().duration(250).style("stroke-opacity",0).style("fill-opacity",0).remove(),e.attr("transform",function(e){return"translate("+s(t.x()(c[e],e))+",0)"}).transition().duration(250).style("stroke-opacity",1).style("fill-opacity",1);if(!u.length)return;r.append("line").attr("x1",0).attr("y1",-n.top).attr("x2",0).attr("y2",b),r.append("text").attr("class","nv-xValue").attr("x",-6).attr("y",-n.top).attr("text-anchor","end").attr("dy",".9em"),C.select(".nv-hoverValue .nv-xValue").text(f(t.x()(c[u[0]],u[0]))),r.append("text").attr("class","nv-yValue").attr("x",6).attr("y",-n.top).attr("text-anchor","start").attr("dy",".9em"),C.select(".nv-hoverValue .nv-yValue").text(l(t.y()(c[u[0]],u[0])))}function M(){function r(e,n){var r=Math.abs(t.x()(e[0],0)-n),i=0;for(var s=0;s-1}),s.width(C).color(["#444","#444","#444"]),I.select(".nv-controlsWrap").datum(R).call(s),u.top!=Math.max(s.height(),i.height())&&(u.top=Math.max(s.height(),i.height()),P=(f||parseInt(M.style("height"))||400)-u.top-u.bottom),I.select(".nv-controlsWrap").attr("transform","translate(0,"+ -u.top+")")}j.attr("transform","translate("+u.left+","+u.top+")"),v&&I.select(".nv-y.nv-axis").attr("transform","translate("+D+",0)"),m&&(o.width(D).height(P).margin({left:u.left,top:u.top}).svgContainer(M).xScale(b),j.select(".nv-interactive").call(o)),t.width(D).height(P);var U=I.select(".nv-stackedWrap").datum(y);U.transition().call(t),p&&(n.scale(b).ticks(D/100).tickSize(-P,0),I.select(".nv-x.nv-axis").attr("transform","translate(0,"+P+")"),I.select(".nv-x.nv-axis").transition().duration(0).call(n)),d&&(r.scale(w).ticks(t.offset()=="wiggle"?0:P/36).tickSize(-D,0).setTickFormat(t.offset()=="expand"?d3.format("%"):E),I.select(".nv-y.nv-axis").transition().duration(0).call(r)),t.dispatch.on("areaClick.toggle",function(e){y.filter(function(e){return!e.disabled}).length===1?y=y.map(function(e){return e.disabled=!1,e}):y=y.map(function(t,n){return t.disabled=n!=e.seriesIndex,t}),S.disabled=y.map(function(e){return!!e.disabled}),N.stateChange(S),O.update()}),i.dispatch.on("stateChange",function(e){S.disabled=e.disabled,N.stateChange(S),O.update()}),s.dispatch.on("legendClick",function(e,n){if(!e.disabled)return;R=R.map(function(e){return e.disabled=!0,e}),e.disabled=!1;switch(e.key){case"Stacked":t.style("stack");break;case"Stream":t.style("stream");break;case"Expanded":t.style("expand")}S.style=t.style(),N.stateChange(S),O.update()}),o.dispatch.on("elementMousemove",function(i){t.clearHighlights();var s,a,f,c=[];y.filter(function(e,t){return e.seriesIndex=t,!e.disabled}).forEach(function(n,r){a=e.interactiveBisect(n.values,i.pointXValue,O.x()),t.highlightPoint(r,a,!0);var o=n.values[a];if(typeof o=="undefined")return;typeof s=="undefined"&&(s=o),typeof f=="undefined"&&(f=O.xScale()(O.x()(o,a))),c.push({key:n.key,value:O.y()(o,a),color:l(n,n.seriesIndex)})});var h=n.tickFormat()(O.x()(s,a));o.tooltip.position({left:f+u.left,top:i.mouseY+u.top}).chartContainer(_.parentNode).enabled(g).valueFormatter(function(e,t){return r.tickFormat()(e)}).data({value:h,series:c})(),o.renderGuideLine(f)}),o.dispatch.on("elementMouseout",function(e){N.tooltipHide(),t.clearHighlights()}),N.on("tooltipShow",function(e){g&&A(e,_.parentNode)}),N.on("changeState",function(e){typeof e.disabled!="undefined"&&(y.forEach(function(t,n){t.disabled=e.disabled[n]}),S.disabled=e.disabled),typeof e.style!="undefined"&&t.style(e.style),O.update()})}),O}var t=e.models.stackedArea(),n=e.models.axis(),r=e.models.axis(),i=e.models.legend(),s=e.models.legend(),o=e.interactiveGuideline(),u={top:30,right:25,bottom:50,left:60},a=null,f=null,l=e.utils.defaultColor(),c=!0,h=!0,p=!0,d=!0,v=!1,m=!1,g=!0,y=function(e,t,n,r,i){return"

"+e+"

"+"

"+n+" on "+t+"

"},b,w,E=d3.format(",.2f"),S={style:t.style()},x=null,T="No Data Available.",N=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),C=250,k=["Stacked","Stream","Expanded"],L=250;n.orient("bottom").tickPadding(7),r.orient(v?"right":"left"),s.updateState(!1);var A=function(i,s){var o=i.pos[0]+(s.offsetLeft||0),u=i.pos[1]+(s.offsetTop||0),a=n.tickFormat()(t.x()(i.point,i.pointIndex)),f=r.tickFormat()(t.y()(i.point,i.pointIndex)),l=y(i.series.key,a,f,i,O);e.tooltip.show([o,u],l,i.value<0?"n":"s",null,s)};return t.dispatch.on("tooltipShow",function(e){e.pos=[e.pos[0]+u.left,e.pos[1]+u.top],N.tooltipShow(e)}),t.dispatch.on("tooltipHide",function(e){N.tooltipHide(e)}),N.on("tooltipHide",function(){g&&e.tooltip.cleanup()}),O.dispatch=N,O.stacked=t,O.legend=i,O.controls=s,O.xAxis=n,O.yAxis=r,O.interactiveLayer=o,d3.rebind(O,t,"x","y","size","xScale","yScale","xDomain","yDomain","xRange","yRange","sizeDomain","interactive","useVoronoi","offset","order","style","clipEdge","forceX","forceY","forceSize","interpolate"),O.options=e.utils.optionsFunc.bind(O),O.margin=function(e){return arguments.length?(u.top=typeof e.top!="undefined"?e.top:u.top,u.right=typeof e.right!="undefined"?e.right:u.right,u.bottom=typeof e.bottom!="undefined"?e.bottom:u.bottom,u.left=typeof e.left!="undefined"?e.left:u.left,O):u},O.width=function(e){return arguments.length?(a=e,O):a},O.height=function(e){return arguments.length?(f=e,O):f},O.color=function(n){return arguments.length?(l=e.utils.getColor(n),i.color(l),t.color(l),O):l},O.showControls=function(e){return arguments.length?(c=e,O):c},O.showLegend=function(e){return arguments.length?(h=e,O):h},O.showXAxis=function(e){return arguments.length?(p=e,O):p},O.showYAxis=function(e){return arguments.length?(d=e,O):d},O.rightAlignYAxis=function(e){return arguments.length?(v=e,r.orient(e?"right":"left"),O):v},O.useInteractiveGuideline=function(e){return arguments.length?(m=e,e===!0&&(O.interactive(!1),O.useVoronoi(!1)),O):m},O.tooltip=function(e){return arguments.length?(y=e,O):y},O.tooltips=function(e){return arguments.length?(g=e,O):g},O.tooltipContent=function(e){return arguments.length?(y=e,O):y},O.state=function(e){return arguments.length?(S=e,O):S},O.defaultState=function(e){return arguments.length?(x=e,O):x},O.noData=function(e){return arguments.length?(T=e,O):T},O.transitionDuration=function(e){return arguments.length?(L=e,O):L},O.controlsData=function(e){return arguments.length?(k=e,O):k},r.setTickFormat=r.tickFormat,r.tickFormat=function(e){return arguments.length?(E=e,r):E},O}})(); \ No newline at end of file +(function(){var c=window.nv||{};c.version="1.1.10b";c.dev=true;window.nv=c;c.tooltip={};c.utils={};c.models={};c.charts={};c.graphs=[];c.logs={};c.dispatch=d3.dispatch("render_start","render_end");if(c.dev){c.dispatch.on("render_start",function(f){c.logs.startTime=+new Date()});c.dispatch.on("render_end",function(f){c.logs.endTime=+new Date();c.logs.totalTime=c.logs.endTime-c.logs.startTime;c.log("total",c.logs.totalTime)})}c.log=function(){if(c.dev&&console.log&&console.log.apply){console.log.apply(console,arguments)}else{if(c.dev&&typeof console.log=="function"&&Function.prototype.bind){var e=Function.prototype.bind.call(console.log,console);e.apply(console,arguments)}}return arguments[arguments.length-1]};c.render=function d(e){e=e||1;c.render.active=true;c.dispatch.render_start();setTimeout(function(){var g,h;for(var f=0;f1){while(ls||y>v||(d3.event.relatedTarget&&d3.event.relatedTarget.ownerSVGElement===undefined)||C){if(l){if(d3.event.relatedTarget&&d3.event.relatedTarget.ownerSVGElement===undefined&&d3.event.relatedTarget.className.match(o.nvPointerEventsClass)){return}}j.elementMouseout({mouseX:z,mouseY:y});h.renderGuideLine(null);return}var x=m.invert(z);j.elementMousemove({mouseX:z,mouseY:y,pointXValue:x})}i.on("mousemove",u,true).on("mouseout",u,true);h.renderGuideLine=function(y){if(!k){return}var z=r.select(".nv-interactiveGuideLine").selectAll("line").data((y!=null)?[c.utils.NaNtoZero(y)]:[],String);z.enter().append("line").attr("class","nv-guideline").attr("x1",function(x){return x}).attr("x2",function(x){return x}).attr("y1",v).attr("y2",0);z.exit().remove()}})}h.dispatch=j;h.tooltip=o;h.margin=function(p){if(!arguments.length){return g}g.top=typeof p.top!="undefined"?p.top:g.top;g.left=typeof p.left!="undefined"?p.left:g.left;return h};h.width=function(p){if(!arguments.length){return e}e=p;return h};h.height=function(p){if(!arguments.length){return n}n=p;return h};h.xScale=function(p){if(!arguments.length){return m}m=p;return h};h.showGuideLine=function(p){if(!arguments.length){return k}k=p;return h};h.svgContainer=function(p){if(!arguments.length){return i}i=p;return h};return h};c.interactiveBisect=function(g,f,k){if(!g instanceof Array){return null}if(typeof k!=="function"){k=function(n,m){return n.x}}var l=d3.bisector(k).left;var h=d3.max([0,l(g,f)-1]);var j=k(g[h],h);if(typeof j==="undefined"){j=h}if(j===f){return h}var e=d3.min([h+1,g.length-1]);var i=k(g[e],e);if(typeof i==="undefined"){i=e}if(Math.abs(i-f)>=Math.abs(j-f)){return h}else{return e}};(function(){window.nv.tooltip={};window.nv.models.tooltip=function(){var r=null,w=null,i="w",h=50,o=25,f=null,t=null,s=null,v={left:null,top:null},l=true,p="nvtooltip-"+Math.floor(Math.random()*100000);var k="nv-pointer-events-none";var e=function(y,x){return y};var q=function(x){return x};var g=function(y){if(r!=null){return r}if(y==null){return""}var x="";if(y.series instanceof Array){y.series.forEach(function(A,z){x+="";x+="";x+="";x+=""})}x+="
"+q(y.value)+"
"+A.key+":"+e(A.value,z)+"
";return x};var j=function(x){if(x&&x.series&&x.series.length>0){return true}return false};function m(){if(s){var x=d3.select(s);if(x.node().tagName!=="svg"){x=x.select("svg")}var z=(x.node())?x.attr("viewBox"):null;if(z){z=z.split(" ");var y=parseInt(x.style("width"))/z[2];v.left=v.left*y;v.top=v.top*y}}}function u(z){var x;if(s){x=d3.select(s)}else{x=d3.select("body")}var y=x.select(".nvtooltip");if(y.node()===null){y=x.append("div").attr("class","nvtooltip "+(t?t:"xy-tooltip")).attr("id",p)}y.node().innerHTML=z;y.style("top",0).style("left",0).style("opacity",0);y.selectAll("div, table, td, tr").classed(k,true);y.classed(k,true);return y.node()}function n(){if(!l){return}if(!j(w)){return}m();var D=v.left;var C=(f!=null)?f:v.top;var x=u(g(w));if(s){var A=s.getElementsByTagName("svg")[0];var z=(A)?A.getBoundingClientRect():s.getBoundingClientRect();var E={left:0,top:0};if(A){var y=A.getBoundingClientRect();var B=s.getBoundingClientRect();E.top=Math.abs(y.top-B.top);E.left=Math.abs(y.left-B.left)}D+=s.offsetLeft+E.left-2*s.scrollLeft;C+=s.offsetTop+E.top-2*s.scrollTop}if(o&&o>0){C=Math.floor(C/o)*o}c.tooltip.calcTooltipPosition([D,C],i,h,x);return n}n.nvPointerEventsClass=k;n.content=function(x){if(!arguments.length){return r}r=x;return n};n.contentGenerator=function(x){if(!arguments.length){return g}if(typeof x==="function"){g=x}return n};n.data=function(x){if(!arguments.length){return w}w=x;return n};n.gravity=function(x){if(!arguments.length){return i}i=x;return n};n.distance=function(x){if(!arguments.length){return h}h=x;return n};n.snapDistance=function(x){if(!arguments.length){return o}o=x;return n};n.classes=function(x){if(!arguments.length){return t}t=x;return n};n.chartContainer=function(x){if(!arguments.length){return s}s=x;return n};n.position=function(x){if(!arguments.length){return v}v.left=(typeof x.left!=="undefined")?x.left:v.left;v.top=(typeof x.top!=="undefined")?x.top:v.top;return n};n.fixedTop=function(x){if(!arguments.length){return f}f=x;return n};n.enabled=function(x){if(!arguments.length){return l}l=x;return n};n.valueFormatter=function(x){if(!arguments.length){return e}if(typeof x==="function"){e=x}return n};n.headerFormatter=function(x){if(!arguments.length){return q}if(typeof x==="function"){q=x}return n};n.id=function(){return p};return n};c.tooltip.show=function(l,h,k,j,i,g){var f=document.createElement("div");f.className="nvtooltip "+(g?g:"xy-tooltip");var e=i;if(!i||i.tagName.match(/g|svg/i)){e=document.getElementsByTagName("body")[0]}f.style.left=0;f.style.top=0;f.style.opacity=0;f.innerHTML=h;e.appendChild(f);if(i){l[0]=l[0]-i.scrollLeft;l[1]=l[1]-i.scrollTop}c.tooltip.calcTooltipPosition(l,k,j,f)};c.tooltip.findFirstNonSVGParent=function(e){while(e.tagName.match(/^g|svg$/i)!==null){e=e.parentNode}return e};c.tooltip.findTotalOffsetTop=function(e,g){var f=g;do{if(!isNaN(e.offsetTop)){f+=(e.offsetTop)}}while(e=e.offsetParent);return f};c.tooltip.findTotalOffsetLeft=function(f,e){var g=e;do{if(!isNaN(f.offsetLeft)){g+=(f.offsetLeft)}}while(f=f.offsetParent);return g};c.tooltip.calcTooltipPosition=function(q,t,o,f){var s=parseInt(f.offsetHeight),g=parseInt(f.offsetWidth),i=c.utils.windowSize().width,e=c.utils.windowSize().height,h=window.pageYOffset,k=window.pageXOffset,j,p;e=window.innerWidth>=document.body.scrollWidth?e:e-16;i=window.innerHeight>=document.body.scrollHeight?i:i-16;t=t||"s";o=o||20;var l=function(u){return c.tooltip.findTotalOffsetTop(u,p)};var r=function(u){return c.tooltip.findTotalOffsetLeft(u,j)};switch(t){case"e":j=q[0]-g-o;p=q[1]-(s/2);var n=r(f);var m=l(f);if(nk?q[0]+o:k-n+j}if(mh+e){p=h+e-m+p-s}break;case"w":j=q[0]+o;p=q[1]-(s/2);var n=r(f);var m=l(f);if(n+g>i){j=q[0]-g-o}if(mh+e){p=h+e-m+p-s}break;case"n":j=q[0]-(g/2)-5;p=q[1]+o;var n=r(f);var m=l(f);if(ni){j=j-g/2+5}if(m+s>h+e){p=h+e-m+p-s}break;case"s":j=q[0]-(g/2);p=q[1]-s-o;var n=r(f);var m=l(f);if(ni){j=j-g/2+5}if(h>m){p=h}break;case"none":j=q[0];p=q[1]-o;var n=r(f);var m=l(f);break}f.style.left=j+"px";f.style.top=p+"px";f.style.opacity=1;f.style.position="absolute";return f};c.tooltip.cleanup=function(){var e=document.getElementsByClassName("nvtooltip");var f=[];while(e.length){f.push(e[0]);e[0].style.transitionDelay="0 !important";e[0].style.opacity=0;e[0].className="nvtooltip-pending-removal"}setTimeout(function(){while(f.length){var g=f.pop();g.parentNode.removeChild(g)}},500)}})();c.utils.windowSize=function(){var e={width:640,height:480};if(document.body&&document.body.offsetWidth){e.width=document.body.offsetWidth;e.height=document.body.offsetHeight}if(document.compatMode=="CSS1Compat"&&document.documentElement&&document.documentElement.offsetWidth){e.width=document.documentElement.offsetWidth;e.height=document.documentElement.offsetHeight}if(window.innerWidth&&window.innerHeight){e.width=window.innerWidth;e.height=window.innerHeight}return(e)};c.utils.windowResize=function(e){if(e===undefined){return}var f=window.onresize;window.onresize=function(g){if(typeof f=="function"){f(g)}e(g)}};c.utils.getColor=function(e){if(!arguments.length){return c.utils.defaultColor()}if(Object.prototype.toString.call(e)==="[object Array]"){return function(g,f){return g.color||e[f%e.length]}}else{return e}};c.utils.defaultColor=function(){var e=d3.scale.category20().range();return function(g,f){return g.color||e[f%e.length]}};c.utils.customTheme=function(h,f,g){f=f||function(i){return i.key};g=g||d3.scale.category20().range();var e=g.length;return function(k,i){var j=f(k);if(!e){e=g.length}if(typeof h[j]!=="undefined"){return(typeof h[j]==="function")?h[j]():h[j]}else{return g[--e]}}};c.utils.pjax=function(e,f){d3.selectAll(e).on("click",function(){history.pushState(this.href,this.textContent,this.href);g(this.href);d3.event.preventDefault()});function g(h){d3.html(h,function(i){var j=d3.select(f).node();j.parentNode.replaceChild(d3.select(i).select(f).node(),j);c.utils.pjax(e,f)})}d3.select(window).on("popstate",function(){if(d3.event.state){g(d3.event.state)}})};c.utils.calcApproxTextWidth=function(e){if(e instanceof d3.selection){var g=parseInt(e.style("font-size").replace("px",""));var f=e.text().length;return f*g*0.5}return 0};c.utils.NaNtoZero=function(e){if(typeof e!=="number"||isNaN(e)||e===null||e===Infinity){return 0}return e};c.utils.optionsFunc=function(e){if(e){d3.map(e).forEach((function(f,g){if(typeof this[f]==="function"){this[f](g)}}).bind(this))}return this};c.models.axis=function(){var j=d3.svg.axis();var m={top:0,right:0,bottom:0,left:0},g=75,s=60,l=d3.scale.linear(),n=null,i=true,k=true,f=0,h=true,o=false,e=false,r=null;j.scale(l).orient("bottom").tickFormat(function(t){return t});var p;function q(t){t.each(function(F){var v=d3.select(this);var y=v.selectAll("g.nv-wrap.nv-axis").data([F]);var B=y.enter().append("g").attr("class","nvd3 nv-wrap nv-axis");var u=B.append("g");var H=y.select("g");if(r!==null){j.ticks(r)}else{if(j.orient()=="top"||j.orient()=="bottom"){j.ticks(Math.abs(l.range()[1]-l.range()[0])/100)}}H.transition().call(j);p=p||j.scale();var A=j.tickFormat();if(A==null){A=p.tickFormat()}var z=H.selectAll("text.nv-axislabel").data([n||null]);z.exit().remove();switch(j.orient()){case"top":z.enter().append("text").attr("class","nv-axislabel");var J=(l.range().length==2)?l.range()[1]:(l.range()[l.range().length-1]+(l.range()[1]-l.range()[0]));z.attr("text-anchor","middle").attr("y",0).attr("x",J/2);if(i){var G=y.selectAll("g.nv-axisMaxMin").data(l.domain());G.enter().append("g").attr("class","nv-axisMaxMin").append("text");G.exit().remove();G.attr("transform",function(K,w){return"translate("+l(K)+",0)"}).select("text").attr("dy","0em").attr("y",-j.tickPadding()).attr("text-anchor","middle").text(function(L,K){var w=A(L);return(""+w).match("NaN")?"":w});G.transition().attr("transform",function(K,w){return"translate("+l.range()[w]+",0)"})}break;case"bottom":var E=36;var x=30;var C=H.selectAll("g").select("text");if(f%360){C.each(function(L,w){var K=this.getBBox().width;if(K>x){x=K}});var I=Math.abs(Math.sin(f*Math.PI/180));var E=(I?I*x:x)+30;C.attr("transform",function(L,K,w){return"rotate("+f+" 0,0)"}).style("text-anchor",f%360>0?"start":"end")}z.enter().append("text").attr("class","nv-axislabel");var J=(l.range().length==2)?l.range()[1]:(l.range()[l.range().length-1]+(l.range()[1]-l.range()[0]));z.attr("text-anchor","middle").attr("y",E).attr("x",J/2);if(i){var G=y.selectAll("g.nv-axisMaxMin").data([l.domain()[0],l.domain()[l.domain().length-1]]);G.enter().append("g").attr("class","nv-axisMaxMin").append("text");G.exit().remove();G.attr("transform",function(K,w){return"translate("+(l(K)+(e?l.rangeBand()/2:0))+",0)"}).select("text").attr("dy",".71em").attr("y",j.tickPadding()).attr("transform",function(L,K,w){return"rotate("+f+" 0,0)"}).style("text-anchor",f?(f%360>0?"start":"end"):"middle").text(function(L,K){var w=A(L);return(""+w).match("NaN")?"":w});G.transition().attr("transform",function(K,w){return"translate("+(l(K)+(e?l.rangeBand()/2:0))+",0)"})}if(o){C.attr("transform",function(K,w){return"translate(0,"+(w%2==0?"0":"12")+")"})}break;case"right":z.enter().append("text").attr("class","nv-axislabel");z.style("text-anchor",h?"middle":"begin").attr("transform",h?"rotate(90)":"").attr("y",h?(-Math.max(m.right,g)+12):-10).attr("x",h?(l.range()[0]/2):j.tickPadding());if(i){var G=y.selectAll("g.nv-axisMaxMin").data(l.domain());G.enter().append("g").attr("class","nv-axisMaxMin").append("text").style("opacity",0);G.exit().remove();G.attr("transform",function(K,w){return"translate(0,"+l(K)+")"}).select("text").attr("dy",".32em").attr("y",0).attr("x",j.tickPadding()).style("text-anchor","start").text(function(L,K){var w=A(L);return(""+w).match("NaN")?"":w});G.transition().attr("transform",function(K,w){return"translate(0,"+l.range()[w]+")"}).select("text").style("opacity",1)}break;case"left":z.enter().append("text").attr("class","nv-axislabel");z.style("text-anchor",h?"middle":"end").attr("transform",h?"rotate(-90)":"").attr("y",h?(-Math.max(m.left,g)+12):-10).attr("x",h?(-l.range()[0]/2):-j.tickPadding());if(i){var G=y.selectAll("g.nv-axisMaxMin").data(l.domain());G.enter().append("g").attr("class","nv-axisMaxMin").append("text").style("opacity",0);G.exit().remove();G.attr("transform",function(K,w){return"translate(0,"+p(K)+")"}).select("text").attr("dy",".32em").attr("y",0).attr("x",-j.tickPadding()).attr("text-anchor","end").text(function(L,K){var w=A(L);return(""+w).match("NaN")?"":w});G.transition().attr("transform",function(K,w){return"translate(0,"+l.range()[w]+")"}).select("text").style("opacity",1)}break}z.text(function(w){return w});if(i&&(j.orient()==="left"||j.orient()==="right")){H.selectAll("g").each(function(K,w){d3.select(this).select("text").attr("opacity",1);if(l(K)l.range()[0]-10){if(K>1e-10||K<-1e-10){d3.select(this).attr("opacity",0)}d3.select(this).select("text").attr("opacity",0)}});if(l.domain()[0]==l.domain()[1]&&l.domain()[0]==0){y.selectAll("g.nv-axisMaxMin").style("opacity",function(K,w){return !w?1:0})}}if(i&&(j.orient()==="top"||j.orient()==="bottom")){var D=[];y.selectAll("g.nv-axisMaxMin").each(function(L,w){try{if(w){D.push(l(L)-this.getBBox().width-4)}else{D.push(l(L)+this.getBBox().width+4)}}catch(K){if(w){D.push(l(L)-4)}else{D.push(l(L)+4)}}});H.selectAll("g").each(function(K,w){if(l(K)D[1]){if(K>1e-10||K<-1e-10){d3.select(this).remove()}else{d3.select(this).select("text").remove()}}})}if(k){H.selectAll(".tick").filter(function(w){return !parseFloat(Math.round(w.__data__*100000)/1000000)&&(w.__data__!==undefined)}).classed("zero",true)}p=l.copy()});return q}q.axis=j;d3.rebind(q,j,"orient","tickValues","tickSubdivide","tickSize","tickPadding","tickFormat");d3.rebind(q,l,"domain","range","rangeBand","rangeBands");q.options=c.utils.optionsFunc.bind(q);q.margin=function(t){if(!arguments.length){return m}m.top=typeof t.top!="undefined"?t.top:m.top;m.right=typeof t.right!="undefined"?t.right:m.right;m.bottom=typeof t.bottom!="undefined"?t.bottom:m.bottom;m.left=typeof t.left!="undefined"?t.left:m.left;return q};q.width=function(t){if(!arguments.length){return g}g=t;return q};q.ticks=function(t){if(!arguments.length){return r}r=t;return q};q.height=function(t){if(!arguments.length){return s}s=t;return q};q.axisLabel=function(t){if(!arguments.length){return n}n=t;return q};q.showMaxMin=function(t){if(!arguments.length){return i}i=t;return q};q.highlightZero=function(t){if(!arguments.length){return k}k=t;return q};q.scale=function(t){if(!arguments.length){return l}l=t;j.scale(l);e=typeof l.rangeBands==="function";d3.rebind(q,l,"domain","range","rangeBand","rangeBands");return q};q.rotateYLabel=function(t){if(!arguments.length){return h}h=t;return q};q.rotateLabels=function(t){if(!arguments.length){return f}f=t;return q};q.staggerLabels=function(t){if(!arguments.length){return o}o=t;return q};return q};c.models.bullet=function(){var k={top:0,right:0,bottom:0,left:0},m="left",q=false,f=function(u){return u.ranges},l=function(u){return u.markers},e=function(u){return u.measures},o=function(u){return u.rangeLabels?u.rangeLabels:[]},s=function(u){return u.markerLabels?u.markerLabels:[]},h=function(u){return u.measureLabels?u.measureLabels:[]},n=[0],g=380,t=30,i=null,j=c.utils.getColor(["#1f77b4"]),p=d3.dispatch("elementMouseover","elementMouseout");function r(u){u.each(function(S,N){var v=g-k.left-k.right,w=t-k.top-k.bottom,K=d3.select(this);var T=f.call(this,S,N).slice().sort(d3.descending),L=l.call(this,S,N).slice().sort(d3.descending),I=e.call(this,S,N).slice().sort(d3.descending),J=o.call(this,S,N).slice(),A=s.call(this,S,N).slice(),Q=h.call(this,S,N).slice();var P=d3.scale.linear().domain(d3.extent(d3.merge([n,T]))).range(q?[v,0]:[0,v]);var R=this.__chart__||d3.scale.linear().domain([0,Infinity]).range(P.range());this.__chart__=P;var y=d3.min(T),B=d3.max(T),x=T[1];var D=K.selectAll("g.nv-wrap.nv-bullet").data([S]);var z=D.enter().append("g").attr("class","nvd3 nv-wrap nv-bullet");var M=z.append("g");var O=D.select("g");M.append("rect").attr("class","nv-range nv-rangeMax");M.append("rect").attr("class","nv-range nv-rangeAvg");M.append("rect").attr("class","nv-range nv-rangeMin");M.append("rect").attr("class","nv-measure");M.append("path").attr("class","nv-markerTriangle");D.attr("transform","translate("+k.left+","+k.top+")");var H=function(U){return Math.abs(R(U)-R(0))},F=function(U){return Math.abs(P(U)-P(0))};var G=function(U){return U<0?R(U):R(0)},E=function(U){return U<0?P(U):P(0)};O.select("rect.nv-rangeMax").attr("height",w).attr("width",F(B>0?B:y)).attr("x",E(B>0?B:y)).datum(B>0?B:y);O.select("rect.nv-rangeAvg").attr("height",w).attr("width",F(x)).attr("x",E(x)).datum(x);O.select("rect.nv-rangeMin").attr("height",w).attr("width",F(B)).attr("x",E(B)).attr("width",F(B>0?y:B)).attr("x",E(B>0?y:B)).datum(B>0?y:B);O.select("rect.nv-measure").style("fill",j).attr("height",w/3).attr("y",w/3).attr("width",I<0?P(0)-P(I[0]):P(I[0])-P(0)).attr("x",E(I)).on("mouseover",function(){p.elementMouseover({value:I[0],label:Q[0]||"Current",pos:[P(I[0]),w/2]})}).on("mouseout",function(){p.elementMouseout({value:I[0],label:Q[0]||"Current"})});var C=w/6;if(L[0]){O.selectAll("path.nv-markerTriangle").attr("transform",function(U){return"translate("+P(L[0])+","+(w/2)+")"}).attr("d","M0,"+C+"L"+C+","+(-C)+" "+(-C)+","+(-C)+"Z").on("mouseover",function(){p.elementMouseover({value:L[0],label:A[0]||"Previous",pos:[P(L[0]),w/2]})}).on("mouseout",function(){p.elementMouseout({value:L[0],label:A[0]||"Previous"})})}else{O.selectAll("path.nv-markerTriangle").remove()}D.selectAll(".nv-range").on("mouseover",function(W,V){var U=J[V]||(!V?"Maximum":V==1?"Mean":"Minimum");p.elementMouseover({value:W,label:U,pos:[P(W),w/2]})}).on("mouseout",function(W,V){var U=J[V]||(!V?"Maximum":V==1?"Mean":"Minimum");p.elementMouseout({value:W,label:U})})});return r}r.dispatch=p;r.options=c.utils.optionsFunc.bind(r);r.orient=function(u){if(!arguments.length){return m}m=u;q=m=="right"||m=="bottom";return r};r.ranges=function(u){if(!arguments.length){return f}f=u;return r};r.markers=function(u){if(!arguments.length){return l}l=u;return r};r.measures=function(u){if(!arguments.length){return e}e=u;return r};r.forceX=function(u){if(!arguments.length){return n}n=u;return r};r.width=function(u){if(!arguments.length){return g}g=u;return r};r.height=function(u){if(!arguments.length){return t}t=u;return r};r.margin=function(u){if(!arguments.length){return k}k.top=typeof u.top!="undefined"?u.top:k.top;k.right=typeof u.right!="undefined"?u.right:k.right;k.bottom=typeof u.bottom!="undefined"?u.bottom:k.bottom;k.left=typeof u.left!="undefined"?u.left:k.left;return r};r.tickFormat=function(u){if(!arguments.length){return i}i=u;return r};r.color=function(u){if(!arguments.length){return j}j=c.utils.getColor(u);return r};return r};c.models.bulletChart=function(){var e=c.models.bullet();var l="left",n=false,j={top:5,right:40,bottom:20,left:120},g=function(u){return u.ranges},k=function(u){return u.markers},f=function(u){return u.measures},h=null,s=55,i=null,p=true,t=function(v,u,A,z,w){return"

"+u+"

"+A+"

"},r="No Data Available.",m=d3.dispatch("tooltipShow","tooltipHide");var q=function(y,u){var x=y.pos[0]+(u.offsetLeft||0)+j.left,w=y.pos[1]+(u.offsetTop||0)+j.top,v=t(y.key,y.label,y.value,y,o);c.tooltip.show([x,w],v,y.value<0?"e":"w",null,u)};function o(u){u.each(function(P,J){var F=d3.select(this);var v=(h||parseInt(F.style("width"))||960)-j.left-j.right,w=s-j.top-j.bottom,z=this;o.update=function(){o(u)};o.container=this;if(!P||!g.call(this,P,J)){var B=F.selectAll(".nv-noData").data([r]);B.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle");B.attr("x",j.left+v/2).attr("y",18+j.top+w/2).text(function(T){return T});return o}else{F.selectAll(".nv-noData").remove()}var S=g.call(this,P,J).slice().sort(d3.descending),H=k.call(this,P,J).slice().sort(d3.descending),D=f.call(this,P,J).slice().sort(d3.descending);var A=F.selectAll("g.nv-wrap.nv-bulletChart").data([P]);var x=A.enter().append("g").attr("class","nvd3 nv-wrap nv-bulletChart");var I=x.append("g");var M=A.select("g");I.append("g").attr("class","nv-bulletWrap");I.append("g").attr("class","nv-titles");A.attr("transform","translate("+j.left+","+j.top+")");var N=d3.scale.linear().domain([0,Math.max(S[0],H[0],D[0])]).range(n?[v,0]:[0,v]);var O=this.__chart__||d3.scale.linear().domain([0,Infinity]).range(N.range());this.__chart__=N;var E=function(T){return Math.abs(O(T)-O(0))},C=function(T){return Math.abs(N(T)-N(0))};var R=I.select(".nv-titles").append("g").attr("text-anchor","end").attr("transform","translate(-6,"+(s-j.top-j.bottom)/2+")");R.append("text").attr("class","nv-title").text(function(T){return T.title});R.append("text").attr("class","nv-subtitle").attr("dy","1em").text(function(T){return T.subtitle});e.width(v).height(w);var Q=M.select(".nv-bulletWrap");d3.transition(Q).call(e);var L=i||N.tickFormat(v/100);var K=M.selectAll("g.nv-tick").data(N.ticks(v/50),function(T){return this.textContent||L(T)});var G=K.enter().append("g").attr("class","nv-tick").attr("transform",function(T){return"translate("+O(T)+",0)"}).style("opacity",0.000001);G.append("line").attr("y1",w).attr("y2",w*7/6);G.append("text").attr("text-anchor","middle").attr("dy","1em").attr("y",w*7/6).text(L);var y=d3.transition(K).attr("transform",function(T){return"translate("+N(T)+",0)"}).style("opacity",1);y.select("line").attr("y1",w).attr("y2",w*7/6);y.select("text").attr("y",w*7/6);d3.transition(K.exit()).attr("transform",function(T){return"translate("+N(T)+",0)"}).style("opacity",0.000001).remove();m.on("tooltipShow",function(T){T.key=P.title;if(p){q(T,z.parentNode)}})});d3.timer.flush();return o}e.dispatch.on("elementMouseover.tooltip",function(u){m.tooltipShow(u)});e.dispatch.on("elementMouseout.tooltip",function(u){m.tooltipHide(u)});m.on("tooltipHide",function(){if(p){c.tooltip.cleanup()}});o.dispatch=m;o.bullet=e;d3.rebind(o,e,"color");o.options=c.utils.optionsFunc.bind(o);o.orient=function(u){if(!arguments.length){return l}l=u;n=l=="right"||l=="bottom";return o};o.ranges=function(u){if(!arguments.length){return g}g=u;return o};o.markers=function(u){if(!arguments.length){return k}k=u;return o};o.measures=function(u){if(!arguments.length){return f}f=u;return o};o.width=function(u){if(!arguments.length){return h}h=u;return o};o.height=function(u){if(!arguments.length){return s}s=u;return o};o.margin=function(u){if(!arguments.length){return j}j.top=typeof u.top!="undefined"?u.top:j.top;j.right=typeof u.right!="undefined"?u.right:j.right;j.bottom=typeof u.bottom!="undefined"?u.bottom:j.bottom;j.left=typeof u.left!="undefined"?u.left:j.left;return o};o.tickFormat=function(u){if(!arguments.length){return i}i=u;return o};o.tooltips=function(u){if(!arguments.length){return p}p=u;return o};o.tooltipContent=function(u){if(!arguments.length){return t}t=u;return o};o.noData=function(u){if(!arguments.length){return r}r=u;return o};return o};c.models.cumulativeLineChart=function(){var f=c.models.line(),r=c.models.axis(),e=c.models.axis(),h=c.models.legend(),A=c.models.legend(),F=c.interactiveGuideline();var C={top:30,right:30,bottom:50,left:60},H=c.utils.defaultColor(),G=null,D=null,I=true,J=true,v=true,q=false,g=true,K=true,u=false,p=true,m=function(O,N,R,Q,P){return"

"+O+"

"+R+" at "+N+"

"},t,s,E=f.id(),l={index:0,rescaleY:p},n=null,k="No Data Available.",i=function(x){return x.average},M=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),z=250;r.orient("bottom").tickPadding(7);e.orient((q)?"right":"left");A.updateState(false);var w=d3.scale.linear(),o={i:0,x:0};var j=function(S,O){var R=S.pos[0]+(O.offsetLeft||0),Q=S.pos[1]+(O.offsetTop||0),N=r.tickFormat()(f.x()(S.point,S.pointIndex)),T=e.tickFormat()(f.y()(S.point,S.pointIndex)),P=m(S.series.key,N,T,S,B);c.tooltip.show([R,Q],P,null,null,O)};function B(x){x.each(function(aj){var W=d3.select(this).classed("nv-chart-"+E,true),T=this;var N=(G||parseInt(W.style("width"))||960)-C.left-C.right,P=(D||parseInt(W.style("height"))||400)-C.top-C.bottom;B.update=function(){W.transition().duration(z).call(B)};B.container=this;l.disabled=aj.map(function(al){return !!al.disabled});if(!n){var ak;n={};for(ak in l){if(l[ak] instanceof Array){n[ak]=l[ak].slice(0)}else{n[ak]=l[ak]}}}var ai=d3.behavior.drag().on("dragstart",ag).on("drag",ah).on("dragend",ab);function ag(am,al){d3.select(B.container).style("cursor","ew-resize")}function ah(am,al){o.x=d3.event.x;o.i=Math.round(w.invert(o.x));Z()}function ab(am,al){d3.select(B.container).style("cursor","auto");l.index=o.i;M.stateChange(l)}if(!aj||!aj.length||!aj.filter(function(al){return al.values.length}).length){var V=W.selectAll(".nv-noData").data([k]);V.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle");V.attr("x",C.left+N/2).attr("y",C.top+P/2).text(function(al){return al});return B}else{W.selectAll(".nv-noData").remove()}t=f.xScale();s=f.yScale();if(!p){var O=aj.filter(function(al){return !al.disabled}).map(function(an,am){var al=d3.extent(an.values,f.y());if(al[0]<-0.95){al[0]=-0.95}return[(al[0]-al[1])/(1+al[1]),(al[1]-al[0])/(1+al[0])]});var Q=[d3.min(O,function(al){return al[0]}),d3.max(O,function(al){return al[1]})];f.yDomain(Q)}else{f.yDomain(null)}w.domain([0,aj[0].values.length-1]).range([0,N]).clamp(true);var aj=L(o.i,aj);var ae=(u)?"none":"all";var U=W.selectAll("g.nv-wrap.nv-cumulativeLine").data([aj]);var Y=U.enter().append("g").attr("class","nvd3 nv-wrap nv-cumulativeLine").append("g");var af=U.select("g");Y.append("g").attr("class","nv-interactive");Y.append("g").attr("class","nv-x nv-axis").style("pointer-events","none");Y.append("g").attr("class","nv-y nv-axis");Y.append("g").attr("class","nv-background");Y.append("g").attr("class","nv-linesWrap").style("pointer-events",ae);Y.append("g").attr("class","nv-avgLinesWrap").style("pointer-events","none");Y.append("g").attr("class","nv-legendWrap");Y.append("g").attr("class","nv-controlsWrap");if(I){h.width(N);af.select(".nv-legendWrap").datum(aj).call(h);if(C.top!=h.height()){C.top=h.height();P=(D||parseInt(W.style("height"))||400)-C.top-C.bottom}af.select(".nv-legendWrap").attr("transform","translate(0,"+(-C.top)+")")}if(K){var S=[{key:"Re-scale y-axis",disabled:!p}];A.width(140).color(["#444","#444","#444"]);af.select(".nv-controlsWrap").datum(S).attr("transform","translate(0,"+(-C.top)+")").call(A)}U.attr("transform","translate("+C.left+","+C.top+")");if(q){af.select(".nv-y.nv-axis").attr("transform","translate("+N+",0)")}var y=aj.filter(function(al){return al.tempDisabled});U.select(".tempDisabled").remove();if(y.length){U.append("text").attr("class","tempDisabled").attr("x",N/2).attr("y","-.71em").style("text-anchor","end").text(y.map(function(al){return al.key}).join(", ")+" values cannot be calculated for this time period.")}if(u){F.width(N).height(P).margin({left:C.left,top:C.top}).svgContainer(W).xScale(t);U.select(".nv-interactive").call(F)}Y.select(".nv-background").append("rect");af.select(".nv-background rect").attr("width",N).attr("height",P);f.y(function(al){return al.display.y}).width(N).height(P).color(aj.map(function(am,al){return am.color||H(am,al)}).filter(function(am,al){return !aj[al].disabled&&!aj[al].tempDisabled}));var aa=af.select(".nv-linesWrap").datum(aj.filter(function(al){return !al.disabled&&!al.tempDisabled}));aa.call(f);aj.forEach(function(am,al){am.seriesIndex=al});var ad=aj.filter(function(al){return !al.disabled&&!!i(al)});var ac=af.select(".nv-avgLinesWrap").selectAll("line").data(ad,function(al){return al.key});var R=function(am){var al=s(i(am));if(al<0){return 0}if(al>P){return P}return al};ac.enter().append("line").style("stroke-width",2).style("stroke-dasharray","10,10").style("stroke",function(am,al){return f.color()(am,am.seriesIndex)}).attr("x1",0).attr("x2",N).attr("y1",R).attr("y2",R);ac.style("stroke-opacity",function(am){var al=s(i(am));if(al<0||al>P){return 0}return 1}).attr("x1",0).attr("x2",N).attr("y1",R).attr("y2",R);ac.exit().remove();var X=aa.selectAll(".nv-indexLine").data([o]);X.enter().append("rect").attr("class","nv-indexLine").attr("width",3).attr("x",-2).attr("fill","red").attr("fill-opacity",0.5).style("pointer-events","all").call(ai);X.attr("transform",function(al){return"translate("+w(al.i)+",0)"}).attr("height",P);if(J){r.scale(t).ticks(Math.min(aj[0].values.length,N/70)).tickSize(-P,0);af.select(".nv-x.nv-axis").attr("transform","translate(0,"+s.range()[0]+")");d3.transition(af.select(".nv-x.nv-axis")).call(r)}if(v){e.scale(s).ticks(P/36).tickSize(-N,0);d3.transition(af.select(".nv-y.nv-axis")).call(e)}function Z(){X.data([o]);var al=B.transitionDuration();B.transitionDuration(0);B.update();B.transitionDuration(al)}af.select(".nv-background rect").on("click",function(){o.x=d3.mouse(this)[0];o.i=Math.round(w.invert(o.x));l.index=o.i;M.stateChange(l);Z()});f.dispatch.on("elementClick",function(al){o.i=al.pointIndex;o.x=w(o.i);l.index=o.i;M.stateChange(l);Z()});A.dispatch.on("legendClick",function(am,al){am.disabled=!am.disabled;p=!am.disabled;l.rescaleY=p;M.stateChange(l);B.update()});h.dispatch.on("stateChange",function(al){l.disabled=al.disabled;M.stateChange(l);B.update()});F.dispatch.on("elementMousemove",function(aq){f.clearHighlights();var ap,ao,al,an=[];aj.filter(function(at,ar){at.seriesIndex=ar;return !at.disabled}).forEach(function(au,at){ao=c.interactiveBisect(au.values,aq.pointXValue,B.x());f.highlightPoint(at,ao,true);var ar=au.values[ao];if(typeof ar==="undefined"){return}if(typeof ap==="undefined"){ap=ar}if(typeof al==="undefined"){al=B.xScale()(B.x()(ar,ao))}an.push({key:au.key,value:B.y()(ar,ao),color:H(au,au.seriesIndex)})});var am=r.tickFormat()(B.x()(ap,ao));F.tooltip.position({left:al+C.left,top:aq.mouseY+C.top}).chartContainer(T.parentNode).enabled(g).valueFormatter(function(at,ar){return e.tickFormat()(at)}).data({value:am,series:an})();F.renderGuideLine(al)});F.dispatch.on("elementMouseout",function(al){M.tooltipHide();f.clearHighlights()});M.on("tooltipShow",function(al){if(g){j(al,T.parentNode)}});M.on("changeState",function(al){if(typeof al.disabled!=="undefined"){aj.forEach(function(an,am){an.disabled=al.disabled[am]});l.disabled=al.disabled}if(typeof al.index!=="undefined"){o.i=al.index;o.x=w(o.i);l.index=al.index;X.data([o])}if(typeof al.rescaleY!=="undefined"){p=al.rescaleY}B.update()})});return B}f.dispatch.on("elementMouseover.tooltip",function(x){x.pos=[x.pos[0]+C.left,x.pos[1]+C.top];M.tooltipShow(x)});f.dispatch.on("elementMouseout.tooltip",function(x){M.tooltipHide(x)});M.on("tooltipHide",function(){if(g){c.tooltip.cleanup()}});B.dispatch=M;B.lines=f;B.legend=h;B.xAxis=r;B.yAxis=e;B.interactiveLayer=F;d3.rebind(B,f,"defined","isArea","x","y","xScale","yScale","size","xDomain","yDomain","xRange","yRange","forceX","forceY","interactive","clipEdge","clipVoronoi","useVoronoi","id");B.options=c.utils.optionsFunc.bind(B);B.margin=function(x){if(!arguments.length){return C}C.top=typeof x.top!="undefined"?x.top:C.top;C.right=typeof x.right!="undefined"?x.right:C.right;C.bottom=typeof x.bottom!="undefined"?x.bottom:C.bottom;C.left=typeof x.left!="undefined"?x.left:C.left;return B};B.width=function(x){if(!arguments.length){return G}G=x;return B};B.height=function(x){if(!arguments.length){return D}D=x;return B};B.color=function(x){if(!arguments.length){return H}H=c.utils.getColor(x);h.color(H);return B};B.rescaleY=function(x){if(!arguments.length){return p}p=x;return p};B.showControls=function(x){if(!arguments.length){return K}K=x;return B};B.useInteractiveGuideline=function(x){if(!arguments.length){return u}u=x;if(x===true){B.interactive(false);B.useVoronoi(false)}return B};B.showLegend=function(x){if(!arguments.length){return I}I=x;return B};B.showXAxis=function(x){if(!arguments.length){return J}J=x;return B};B.showYAxis=function(x){if(!arguments.length){return v}v=x;return B};B.rightAlignYAxis=function(x){if(!arguments.length){return q}q=x;e.orient((x)?"right":"left");return B};B.tooltips=function(x){if(!arguments.length){return g}g=x;return B};B.tooltipContent=function(x){if(!arguments.length){return m}m=x;return B};B.state=function(x){if(!arguments.length){return l}l=x;return B};B.defaultState=function(x){if(!arguments.length){return n}n=x;return B};B.noData=function(x){if(!arguments.length){return k}k=x;return B};B.average=function(x){if(!arguments.length){return i}i=x;return B};B.transitionDuration=function(x){if(!arguments.length){return z}z=x;return B};function L(x,y){return y.map(function(N,P){if(!N.values){return N}var O=f.y()(N.values[x],x);if(O<-0.95){N.tempDisabled=true;return N}N.tempDisabled=false;N.values=N.values.map(function(Q,R){Q.display={y:(f.y()(Q,R)-O)/(1+O)};return Q});return N})}return B};c.models.discreteBar=function(){var k={top:0,right:0,bottom:0,left:0},o=960,m=500,n=Math.floor(Math.random()*10000),i=d3.scale.ordinal(),h=d3.scale.linear(),v=function(x){return x.x},t=function(x){return x.y},f=[0],s=c.utils.defaultColor(),w=false,g=d3.format(",.2f"),q,p,l,r,A=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout"),z="discreteBar";var u,e;function j(x){x.each(function(I){var L=o-k.left-k.right,E=m-k.top-k.bottom,B=d3.select(this);I=I.map(function(N,M){N.values=N.values.map(function(O){O.series=M;return O});return N});var D=(q&&p)?[]:I.map(function(M){return M.values.map(function(O,N){return{x:v(O,N),y:t(O,N),y0:O.y0}})});i.domain(q||d3.merge(D).map(function(M){return M.x})).rangeBands(l||[0,L],0.1);h.domain(p||d3.extent(d3.merge(D).map(function(M){return M.y}).concat(f)));if(w){h.range(r||[E-(h.domain()[0]<0?12:0),h.domain()[1]>0?12:0])}else{h.range(r||[E,0])}u=u||i;e=e||h.copy().range([h(0),h(0)]);var C=B.selectAll("g.nv-wrap.nv-discretebar").data([I]);var G=C.enter().append("g").attr("class","nvd3 nv-wrap nv-discretebar");var y=G.append("g");var J=C.select("g");y.append("g").attr("class","nv-groups");C.attr("transform","translate("+k.left+","+k.top+")");var F=C.select(".nv-groups").selectAll(".nv-group").data(function(M){return M},function(M){return M.key});F.enter().append("g").style("stroke-opacity",0.000001).style("fill-opacity",0.000001);F.exit().transition().style("stroke-opacity",0.000001).style("fill-opacity",0.000001).remove();F.attr("class",function(N,M){return"nv-group nv-series-"+M}).classed("hover",function(M){return M.hover});F.transition().style("stroke-opacity",1).style("fill-opacity",0.75);var K=F.selectAll("g.nv-bar").data(function(M){return M.values});K.exit().remove();var H=K.enter().append("g").attr("transform",function(O,N,M){return"translate("+(i(v(O,N))+i.rangeBand()*0.05)+", "+h(0)+")"}).on("mouseover",function(N,M){d3.select(this).classed("hover",true);A.elementMouseover({value:t(N,M),point:N,series:I[N.series],pos:[i(v(N,M))+(i.rangeBand()*(N.series+0.5)/I.length),h(t(N,M))],pointIndex:M,seriesIndex:N.series,e:d3.event})}).on("mouseout",function(N,M){d3.select(this).classed("hover",false);A.elementMouseout({value:t(N,M),point:N,series:I[N.series],pointIndex:M,seriesIndex:N.series,e:d3.event})}).on("click",function(N,M){A.elementClick({value:t(N,M),point:N,series:I[N.series],pos:[i(v(N,M))+(i.rangeBand()*(N.series+0.5)/I.length),h(t(N,M))],pointIndex:M,seriesIndex:N.series,e:d3.event});d3.event.stopPropagation()}).on("dblclick",function(N,M){A.elementDblClick({value:t(N,M),point:N,series:I[N.series],pos:[i(v(N,M))+(i.rangeBand()*(N.series+0.5)/I.length),h(t(N,M))],pointIndex:M,seriesIndex:N.series,e:d3.event});d3.event.stopPropagation()});H.append("rect").attr("height",0).attr("width",i.rangeBand()*0.9/I.length);if(w){H.append("text").attr("text-anchor","middle");K.select("text").text(function(N,M){return g(t(N,M))}).transition().attr("x",i.rangeBand()*0.9/2).attr("y",function(N,M){return t(N,M)<0?h(t(N,M))-h(0)+12:-4})}else{K.selectAll("text").remove()}K.attr("class",function(N,M){return t(N,M)<0?"nv-bar negative":"nv-bar positive"}).style("fill",function(N,M){return N.color||s(N,M)}).style("stroke",function(N,M){return N.color||s(N,M)}).select("rect").attr("class",z).transition().attr("width",i.rangeBand()*0.9/I.length);K.transition().attr("transform",function(P,M){var O=i(v(P,M))+i.rangeBand()*0.05,N=t(P,M)<0?h(0):h(0)-h(t(P,M))<1?h(0)-1:h(t(P,M));return"translate("+O+", "+N+")"}).select("rect").attr("height",function(N,M){return Math.max(Math.abs(h(t(N,M))-h((p&&p[0])||0))||1)});u=i.copy();e=h.copy()});return j}j.dispatch=A;j.options=c.utils.optionsFunc.bind(j);j.x=function(x){if(!arguments.length){return v}v=x;return j};j.y=function(x){if(!arguments.length){return t}t=x;return j};j.margin=function(x){if(!arguments.length){return k}k.top=typeof x.top!="undefined"?x.top:k.top;k.right=typeof x.right!="undefined"?x.right:k.right;k.bottom=typeof x.bottom!="undefined"?x.bottom:k.bottom;k.left=typeof x.left!="undefined"?x.left:k.left;return j};j.width=function(x){if(!arguments.length){return o}o=x;return j};j.height=function(x){if(!arguments.length){return m}m=x;return j};j.xScale=function(x){if(!arguments.length){return i}i=x;return j};j.yScale=function(x){if(!arguments.length){return h}h=x;return j};j.xDomain=function(x){if(!arguments.length){return q}q=x;return j};j.yDomain=function(x){if(!arguments.length){return p}p=x;return j};j.xRange=function(x){if(!arguments.length){return l}l=x;return j};j.yRange=function(x){if(!arguments.length){return r}r=x;return j};j.forceY=function(x){if(!arguments.length){return f}f=x;return j};j.color=function(x){if(!arguments.length){return s}s=c.utils.getColor(x);return j};j.id=function(x){if(!arguments.length){return n}n=x;return j};j.showValues=function(x){if(!arguments.length){return w}w=x;return j};j.valueFormat=function(x){if(!arguments.length){return g}g=x;return j};j.rectClass=function(x){if(!arguments.length){return z}z=x;return j};return j};c.models.discreteBarChart=function(){var w=c.models.discreteBar(),l=c.models.axis(),e=c.models.axis();var r={top:15,right:10,bottom:50,left:60},t=null,s=null,u=c.utils.getColor(),v=true,o=true,k=false,g=false,f=true,j=function(B,A,E,D,C){return"

"+A+"

"+E+"

"},n,m,i="No Data Available.",z=d3.dispatch("tooltipShow","tooltipHide","beforeUpdate"),p=250;l.orient("bottom").highlightZero(false).showMaxMin(false).tickFormat(function(x){return x});e.orient((k)?"right":"left").tickFormat(d3.format(",.1f"));var h=function(F,B){var E=F.pos[0]+(B.offsetLeft||0),D=F.pos[1]+(B.offsetTop||0),A=l.tickFormat()(w.x()(F.point,F.pointIndex)),G=e.tickFormat()(w.y()(F.point,F.pointIndex)),C=j(F.series.key,A,G,F,q);c.tooltip.show([E,D],C,F.value<0?"n":"s",null,B)};function q(x){x.each(function(G){var A=d3.select(this),J=this;var K=(t||parseInt(A.style("width"))||960)-r.left-r.right,E=(s||parseInt(A.style("height"))||400)-r.top-r.bottom;q.update=function(){z.beforeUpdate();A.transition().duration(p).call(q)};q.container=this;if(!G||!G.length||!G.filter(function(L){return L.values.length}).length){var B=A.selectAll(".nv-noData").data([i]);B.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle");B.attr("x",r.left+K/2).attr("y",r.top+E/2).text(function(L){return L});return q}else{A.selectAll(".nv-noData").remove()}n=w.xScale();m=w.yScale().clamp(true);var C=A.selectAll("g.nv-wrap.nv-discreteBarWithAxes").data([G]);var y=C.enter().append("g").attr("class","nvd3 nv-wrap nv-discreteBarWithAxes").append("g");var D=y.append("defs");var H=C.select("g");y.append("g").attr("class","nv-x nv-axis");y.append("g").attr("class","nv-y nv-axis");y.append("g").attr("class","nv-barsWrap");H.attr("transform","translate("+r.left+","+r.top+")");if(k){H.select(".nv-y.nv-axis").attr("transform","translate("+K+",0)")}w.width(K).height(E);var I=H.select(".nv-barsWrap").datum(G.filter(function(L){return !L.disabled}));I.transition().call(w);D.append("clipPath").attr("id","nv-x-label-clip-"+w.id()).append("rect");H.select("#nv-x-label-clip-"+w.id()+" rect").attr("width",n.rangeBand()*(g?2:1)).attr("height",16).attr("x",-n.rangeBand()/(g?1:2));if(v){l.scale(n).ticks(K/100).tickSize(-E,0);H.select(".nv-x.nv-axis").attr("transform","translate(0,"+(m.range()[0]+((w.showValues()&&m.domain()[0]<0)?16:0))+")");H.select(".nv-x.nv-axis").transition().call(l);var F=H.select(".nv-x.nv-axis").selectAll("g");if(g){F.selectAll("text").attr("transform",function(N,M,L){return"translate(0,"+(L%2==0?"5":"17")+")"})}}if(o){e.scale(m).ticks(E/36).tickSize(-K,0);H.select(".nv-y.nv-axis").transition().call(e)}z.on("tooltipShow",function(L){if(f){h(L,J.parentNode)}})});return q}w.dispatch.on("elementMouseover.tooltip",function(x){x.pos=[x.pos[0]+r.left,x.pos[1]+r.top];z.tooltipShow(x)});w.dispatch.on("elementMouseout.tooltip",function(x){z.tooltipHide(x)});z.on("tooltipHide",function(){if(f){c.tooltip.cleanup()}});q.dispatch=z;q.discretebar=w;q.xAxis=l;q.yAxis=e;d3.rebind(q,w,"x","y","xDomain","yDomain","xRange","yRange","forceX","forceY","id","showValues","valueFormat");q.options=c.utils.optionsFunc.bind(q);q.margin=function(x){if(!arguments.length){return r}r.top=typeof x.top!="undefined"?x.top:r.top;r.right=typeof x.right!="undefined"?x.right:r.right;r.bottom=typeof x.bottom!="undefined"?x.bottom:r.bottom;r.left=typeof x.left!="undefined"?x.left:r.left;return q};q.width=function(x){if(!arguments.length){return t}t=x;return q};q.height=function(x){if(!arguments.length){return s}s=x;return q};q.color=function(x){if(!arguments.length){return u}u=c.utils.getColor(x);w.color(u);return q};q.showXAxis=function(x){if(!arguments.length){return v}v=x;return q};q.showYAxis=function(x){if(!arguments.length){return o}o=x;return q};q.rightAlignYAxis=function(x){if(!arguments.length){return k}k=x;e.orient((x)?"right":"left");return q};q.staggerLabels=function(x){if(!arguments.length){return g}g=x;return q};q.tooltips=function(x){if(!arguments.length){return f}f=x;return q};q.tooltipContent=function(x){if(!arguments.length){return j}j=x;return q};q.noData=function(x){if(!arguments.length){return i}i=x;return q};q.transitionDuration=function(x){if(!arguments.length){return p}p=x;return q};return q};c.models.distribution=function(){var h={top:0,right:0,bottom:0,left:0},e=400,n=8,f="x",k=function(o){return o[f]},i=c.utils.defaultColor(),g=d3.scale.linear(),j;var l;function m(o){o.each(function(t){var u=e-(f==="x"?h.left+h.right:h.top+h.bottom),x=f=="x"?"y":"x",q=d3.select(this);l=l||g;var r=q.selectAll("g.nv-distribution").data([t]);var s=r.enter().append("g").attr("class","nvd3 nv-distribution");var p=s.append("g");var v=r.select("g");r.attr("transform","translate("+h.left+","+h.top+")");var y=v.selectAll("g.nv-dist").data(function(z){return z},function(z){return z.key});y.enter().append("g");y.attr("class",function(A,z){return"nv-dist nv-series-"+z}).style("stroke",function(A,z){return i(A,z)});var w=y.selectAll("line.nv-dist"+f).data(function(z){return z.values});w.enter().append("line").attr(f+"1",function(A,z){return l(k(A,z))}).attr(f+"2",function(A,z){return l(k(A,z))});y.exit().selectAll("line.nv-dist"+f).transition().attr(f+"1",function(A,z){return g(k(A,z))}).attr(f+"2",function(A,z){return g(k(A,z))}).style("stroke-opacity",0).remove();w.attr("class",function(A,z){return"nv-dist"+f+" nv-dist"+f+"-"+z}).attr(x+"1",0).attr(x+"2",n);w.transition().attr(f+"1",function(A,z){return g(k(A,z))}).attr(f+"2",function(A,z){return g(k(A,z))});l=g.copy()});return m}m.options=c.utils.optionsFunc.bind(m);m.margin=function(o){if(!arguments.length){return h}h.top=typeof o.top!="undefined"?o.top:h.top;h.right=typeof o.right!="undefined"?o.right:h.right;h.bottom=typeof o.bottom!="undefined"?o.bottom:h.bottom;h.left=typeof o.left!="undefined"?o.left:h.left;return m};m.width=function(o){if(!arguments.length){return e}e=o;return m};m.axis=function(o){if(!arguments.length){return f}f=o;return m};m.size=function(o){if(!arguments.length){return n}n=o;return m};m.getData=function(o){if(!arguments.length){return k}k=d3.functor(o);return m};m.scale=function(o){if(!arguments.length){return g}g=o;return m};m.color=function(o){if(!arguments.length){return i}i=c.utils.getColor(o);return m};return m};c.models.historicalBar=function(){var k={top:0,right:0,bottom:0,left:0},o=960,m=500,n=Math.floor(Math.random()*10000),h=d3.scale.linear(),g=d3.scale.linear(),u=function(x){return x.x},t=function(x){return x.y},f=[],e=[0],i=false,w=true,s=c.utils.defaultColor(),q,p,l,r,z=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout"),v=true;function j(x){x.each(function(G){var J=o-k.left-k.right,C=m-k.top-k.bottom,A=d3.select(this);h.domain(q||d3.extent(G[0].values.map(u).concat(f)));if(i){h.range(l||[J*0.5/G[0].values.length,J*(G[0].values.length-0.5)/G[0].values.length])}else{h.range(l||[0,J])}g.domain(p||d3.extent(G[0].values.map(t).concat(e))).range(r||[C,0]);if(h.domain()[0]===h.domain()[1]){h.domain()[0]?h.domain([h.domain()[0]-h.domain()[0]*0.01,h.domain()[1]+h.domain()[1]*0.01]):h.domain([-1,1])}if(g.domain()[0]===g.domain()[1]){g.domain()[0]?g.domain([g.domain()[0]+g.domain()[0]*0.01,g.domain()[1]-g.domain()[1]*0.01]):g.domain([-1,1])}var B=A.selectAll("g.nv-wrap.nv-historicalBar-"+n).data([G[0].values]);var E=B.enter().append("g").attr("class","nvd3 nv-wrap nv-historicalBar-"+n);var D=E.append("defs");var y=E.append("g");var H=B.select("g");y.append("g").attr("class","nv-bars");B.attr("transform","translate("+k.left+","+k.top+")");A.on("click",function(L,K){z.chartClick({data:L,index:K,pos:d3.event,id:n})});D.append("clipPath").attr("id","nv-chart-clip-path-"+n).append("rect");B.select("#nv-chart-clip-path-"+n+" rect").attr("width",J).attr("height",C);H.attr("clip-path",w?"url(#nv-chart-clip-path-"+n+")":"");var I=B.select(".nv-bars").selectAll(".nv-bar").data(function(K){return K},function(L,K){return u(L,K)});I.exit().remove();var F=I.enter().append("rect").attr("x",0).attr("y",function(L,K){return c.utils.NaNtoZero(g(Math.max(0,t(L,K))))}).attr("height",function(L,K){return c.utils.NaNtoZero(Math.abs(g(t(L,K))-g(0)))}).attr("transform",function(L,K){return"translate("+(h(u(L,K))-J/G[0].values.length*0.45)+",0)"}).on("mouseover",function(L,K){if(!v){return}d3.select(this).classed("hover",true);z.elementMouseover({point:L,series:G[0],pos:[h(u(L,K)),g(t(L,K))],pointIndex:K,seriesIndex:0,e:d3.event})}).on("mouseout",function(L,K){if(!v){return}d3.select(this).classed("hover",false);z.elementMouseout({point:L,series:G[0],pointIndex:K,seriesIndex:0,e:d3.event})}).on("click",function(L,K){if(!v){return}z.elementClick({value:t(L,K),data:L,index:K,pos:[h(u(L,K)),g(t(L,K))],e:d3.event,id:n});d3.event.stopPropagation()}).on("dblclick",function(L,K){if(!v){return}z.elementDblClick({value:t(L,K),data:L,index:K,pos:[h(u(L,K)),g(t(L,K))],e:d3.event,id:n});d3.event.stopPropagation()});I.attr("fill",function(L,K){return s(L,K)}).attr("class",function(M,L,K){return(t(M,L)<0?"nv-bar negative":"nv-bar positive")+" nv-bar-"+K+"-"+L}).transition().attr("transform",function(L,K){return"translate("+(h(u(L,K))-J/G[0].values.length*0.45)+",0)"}).attr("width",(J/G[0].values.length)*0.9);I.transition().attr("y",function(M,K){var L=t(M,K)<0?g(0):g(0)-g(t(M,K))<1?g(0)-1:g(t(M,K));return c.utils.NaNtoZero(L)}).attr("height",function(L,K){return c.utils.NaNtoZero(Math.max(Math.abs(g(t(L,K))-g(0)),1))})});return j}j.highlightPoint=function(y,x){d3.select(".nv-historicalBar-"+n).select(".nv-bars .nv-bar-0-"+y).classed("hover",x)};j.clearHighlights=function(){d3.select(".nv-historicalBar-"+n).select(".nv-bars .nv-bar.hover").classed("hover",false)};j.dispatch=z;j.options=c.utils.optionsFunc.bind(j);j.x=function(x){if(!arguments.length){return u}u=x;return j};j.y=function(x){if(!arguments.length){return t}t=x;return j};j.margin=function(x){if(!arguments.length){return k}k.top=typeof x.top!="undefined"?x.top:k.top;k.right=typeof x.right!="undefined"?x.right:k.right;k.bottom=typeof x.bottom!="undefined"?x.bottom:k.bottom;k.left=typeof x.left!="undefined"?x.left:k.left;return j};j.width=function(x){if(!arguments.length){return o}o=x;return j};j.height=function(x){if(!arguments.length){return m}m=x;return j};j.xScale=function(x){if(!arguments.length){return h}h=x;return j};j.yScale=function(x){if(!arguments.length){return g}g=x;return j};j.xDomain=function(x){if(!arguments.length){return q}q=x;return j};j.yDomain=function(x){if(!arguments.length){return p}p=x;return j};j.xRange=function(x){if(!arguments.length){return l}l=x;return j};j.yRange=function(x){if(!arguments.length){return r}r=x;return j};j.forceX=function(x){if(!arguments.length){return f}f=x;return j};j.forceY=function(x){if(!arguments.length){return e}e=x;return j};j.padData=function(x){if(!arguments.length){return i}i=x;return j};j.clipEdge=function(x){if(!arguments.length){return w}w=x;return j};j.color=function(x){if(!arguments.length){return s}s=c.utils.getColor(x);return j};j.id=function(x){if(!arguments.length){return n}n=x;return j};j.interactive=function(x){if(!arguments.length){return v}v=false;return j};return j};c.models.historicalBarChart=function(){var v=c.models.historicalBar(),n=c.models.axis(),e=c.models.axis(),g=c.models.legend();var t={top:30,right:90,bottom:50,left:90},z=c.utils.defaultColor(),w=null,u=null,A=false,B=true,q=true,m=false,f=true,j=function(E,D,H,G,F){return"

"+E+"

"+H+" at "+D+"

"},p,o,k={},l=null,i="No Data Available.",C=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),r=250;n.orient("bottom").tickPadding(7);e.orient((m)?"right":"left");var h=function(G,L){if(L){var E=d3.select(L).select("svg");var M=(E.node())?E.attr("viewBox"):null;if(M){M=M.split(" ");var H=parseInt(E.style("width"))/M[2];G.pos[0]=G.pos[0]*H;G.pos[1]=G.pos[1]*H}}var D=G.pos[0]+(L.offsetLeft||0),J=G.pos[1]+(L.offsetTop||0),K=n.tickFormat()(v.x()(G.point,G.pointIndex)),I=e.tickFormat()(v.y()(G.point,G.pointIndex)),F=j(G.series.key,K,I,G,s);c.tooltip.show([D,J],F,null,null,L)};function s(x){x.each(function(H){var D=d3.select(this),K=this;var M=(w||parseInt(D.style("width"))||960)-t.left-t.right,G=(u||parseInt(D.style("height"))||400)-t.top-t.bottom;s.update=function(){D.transition().duration(r).call(s)};s.container=this;k.disabled=H.map(function(N){return !!N.disabled});if(!l){var L;l={};for(L in k){if(k[L] instanceof Array){l[L]=k[L].slice(0)}else{l[L]=k[L]}}}if(!H||!H.length||!H.filter(function(N){return N.values.length}).length){var E=D.selectAll(".nv-noData").data([i]);E.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle");E.attr("x",t.left+M/2).attr("y",t.top+G/2).text(function(N){return N});return s}else{D.selectAll(".nv-noData").remove()}p=v.xScale();o=v.yScale();var F=D.selectAll("g.nv-wrap.nv-historicalBarChart").data([H]);var y=F.enter().append("g").attr("class","nvd3 nv-wrap nv-historicalBarChart").append("g");var I=F.select("g");y.append("g").attr("class","nv-x nv-axis");y.append("g").attr("class","nv-y nv-axis");y.append("g").attr("class","nv-barsWrap");y.append("g").attr("class","nv-legendWrap");if(A){g.width(M);I.select(".nv-legendWrap").datum(H).call(g);if(t.top!=g.height()){t.top=g.height();G=(u||parseInt(D.style("height"))||400)-t.top-t.bottom}F.select(".nv-legendWrap").attr("transform","translate(0,"+(-t.top)+")")}F.attr("transform","translate("+t.left+","+t.top+")");if(m){I.select(".nv-y.nv-axis").attr("transform","translate("+M+",0)")}v.width(M).height(G).color(H.map(function(O,N){return O.color||z(O,N)}).filter(function(O,N){return !H[N].disabled}));var J=I.select(".nv-barsWrap").datum(H.filter(function(N){return !N.disabled}));J.transition().call(v);if(B){n.scale(p).tickSize(-G,0);I.select(".nv-x.nv-axis").attr("transform","translate(0,"+o.range()[0]+")");I.select(".nv-x.nv-axis").transition().call(n)}if(q){e.scale(o).ticks(G/36).tickSize(-M,0);I.select(".nv-y.nv-axis").transition().call(e)}g.dispatch.on("legendClick",function(O,N){O.disabled=!O.disabled;if(!H.filter(function(P){return !P.disabled}).length){H.map(function(P){P.disabled=false;F.selectAll(".nv-series").classed("disabled",false);return P})}k.disabled=H.map(function(P){return !!P.disabled});C.stateChange(k);x.transition().call(s)});g.dispatch.on("legendDblclick",function(N){H.forEach(function(O){O.disabled=true});N.disabled=false;k.disabled=H.map(function(O){return !!O.disabled});C.stateChange(k);s.update()});C.on("tooltipShow",function(N){if(f){h(N,K.parentNode)}});C.on("changeState",function(N){if(typeof N.disabled!=="undefined"){H.forEach(function(P,O){P.disabled=N.disabled[O]});k.disabled=N.disabled}x.call(s)})});return s}v.dispatch.on("elementMouseover.tooltip",function(x){x.pos=[x.pos[0]+t.left,x.pos[1]+t.top];C.tooltipShow(x)});v.dispatch.on("elementMouseout.tooltip",function(x){C.tooltipHide(x)});C.on("tooltipHide",function(){if(f){c.tooltip.cleanup()}});s.dispatch=C;s.bars=v;s.legend=g;s.xAxis=n;s.yAxis=e;d3.rebind(s,v,"defined","isArea","x","y","size","xScale","yScale","xDomain","yDomain","xRange","yRange","forceX","forceY","interactive","clipEdge","clipVoronoi","id","interpolate","highlightPoint","clearHighlights","interactive");s.options=c.utils.optionsFunc.bind(s);s.margin=function(x){if(!arguments.length){return t}t.top=typeof x.top!="undefined"?x.top:t.top;t.right=typeof x.right!="undefined"?x.right:t.right;t.bottom=typeof x.bottom!="undefined"?x.bottom:t.bottom;t.left=typeof x.left!="undefined"?x.left:t.left;return s};s.width=function(x){if(!arguments.length){return w}w=x;return s};s.height=function(x){if(!arguments.length){return u}u=x;return s};s.color=function(x){if(!arguments.length){return z}z=c.utils.getColor(x);g.color(z);return s};s.showLegend=function(x){if(!arguments.length){return A}A=x;return s};s.showXAxis=function(x){if(!arguments.length){return B}B=x;return s};s.showYAxis=function(x){if(!arguments.length){return q}q=x;return s};s.rightAlignYAxis=function(x){if(!arguments.length){return m}m=x;e.orient((x)?"right":"left");return s};s.tooltips=function(x){if(!arguments.length){return f}f=x;return s};s.tooltipContent=function(x){if(!arguments.length){return j}j=x;return s};s.state=function(x){if(!arguments.length){return k}k=x;return s};s.defaultState=function(x){if(!arguments.length){return l}l=x;return s};s.noData=function(x){if(!arguments.length){return i}i=x;return s};s.transitionDuration=function(x){if(!arguments.length){return r}r=x;return s};return s};c.models.indentedTree=function(){var i={top:0,right:0,bottom:0,left:0},g=960,t=500,j=c.utils.defaultColor(),f=Math.floor(Math.random()*10000),l=true,u=false,s="No Data Available.",m=20,h=[{key:"key",label:"Name",type:"text"}],q=null,e="images/grey-plus.png",k="images/grey-minus.png",n=d3.dispatch("elementClick","elementDblclick","elementMouseover","elementMouseout"),p=function(v){return v.url};var r=0;function o(v){v.each(function(L){var M=1,A=d3.select(this);var B=d3.layout.tree().children(function(O){return O.values}).size([t,m]);o.update=function(){A.transition().duration(600).call(o)};if(!L[0]){L[0]={key:s}}var D=B.nodes(L[0]);var z=d3.select(this).selectAll("div").data([[D]]);var x=z.enter().append("div").attr("class","nvd3 nv-wrap nv-indentedtree");var N=x.append("table");var I=z.select("table").attr("width","100%").attr("class",q);if(l){var H=N.append("thead");var K=H.append("tr");h.forEach(function(O){K.append("th").attr("width",O.width?O.width:"10%").style("text-align",O.type=="numeric"?"right":"left").append("span").text(O.label)})}var w=I.selectAll("tbody").data(function(O){return O});w.enter().append("tbody");M=d3.max(D,function(O){return O.depth});B.size([t,M*m]);var F=w.selectAll("tr").data(function(O){return O.filter(function(P){return(u&&!P.children)?u(P):true})},function(P,O){return P.id||(P.id||++r)});F.exit().remove();F.select("img.nv-treeicon").attr("src",J).classed("folded",C);var y=F.enter().append("tr");h.forEach(function(P,O){var Q=y.append("td").style("padding-left",function(R){return(O?0:R.depth*m+12+(J(R)?0:16))+"px"},"important").style("text-align",P.type=="numeric"?"right":"left");if(O==0){Q.append("img").classed("nv-treeicon",true).classed("nv-folded",C).attr("src",J).style("width","14px").style("height","14px").style("padding","0 1px").style("display",function(R){return J(R)?"inline-block":"none"}).on("click",E)}Q.each(function(R){if(!O&&p(R)){d3.select(this).append("a").attr("href",p).attr("class",d3.functor(P.classes)).append("span")}else{d3.select(this).append("span")}d3.select(this).select("span").attr("class",d3.functor(P.classes)).text(function(S){return P.format?P.format(S):(S[P.key]||"-")})});if(P.showCount){Q.append("span").attr("class","nv-childrenCount");F.selectAll("span.nv-childrenCount").text(function(R){return((R.values&&R.values.length)||(R._values&&R._values.length))?"("+((R.values&&(R.values.filter(function(S){return u?u(S):true}).length))||(R._values&&R._values.filter(function(S){return u?u(S):true}).length)||0)+")":""})}});F.order().on("click",function(O){n.elementClick({row:this,data:O,pos:[O.x,O.y]})}).on("dblclick",function(O){n.elementDblclick({row:this,data:O,pos:[O.x,O.y]})}).on("mouseover",function(O){n.elementMouseover({row:this,data:O,pos:[O.x,O.y]})}).on("mouseout",function(O){n.elementMouseout({row:this,data:O,pos:[O.x,O.y]})});function E(Q,P,O){d3.event.stopPropagation();if(d3.event.shiftKey&&!O){d3.event.shiftKey=false;Q.values&&Q.values.forEach(function(R){if(R.values||R._values){E(R,0,true)}});return true}if(!G(Q)){return true}if(Q.values){Q._values=Q.values;Q.values=null}else{Q.values=Q._values;Q._values=null}o.update()}function J(O){return(O._values&&O._values.length)?e:(O.values&&O.values.length)?k:""}function C(O){return(O._values&&O._values.length)}function G(P){var O=P.values||P._values;return(O&&O.length)}});return o}o.options=c.utils.optionsFunc.bind(o);o.margin=function(v){if(!arguments.length){return i}i.top=typeof v.top!="undefined"?v.top:i.top;i.right=typeof v.right!="undefined"?v.right:i.right;i.bottom=typeof v.bottom!="undefined"?v.bottom:i.bottom;i.left=typeof v.left!="undefined"?v.left:i.left;return o};o.width=function(v){if(!arguments.length){return g}g=v;return o};o.height=function(v){if(!arguments.length){return t}t=v;return o};o.color=function(v){if(!arguments.length){return j}j=c.utils.getColor(v);scatter.color(j);return o};o.id=function(v){if(!arguments.length){return f}f=v;return o};o.header=function(v){if(!arguments.length){return l}l=v;return o};o.noData=function(v){if(!arguments.length){return s}s=v;return o};o.filterZero=function(v){if(!arguments.length){return u}u=v;return o};o.columns=function(v){if(!arguments.length){return h}h=v;return o};o.tableClass=function(v){if(!arguments.length){return q}q=v;return o};o.iconOpen=function(v){if(!arguments.length){return e}e=v;return o};o.iconClose=function(v){if(!arguments.length){return k}k=v;return o};o.getUrl=function(v){if(!arguments.length){return p}p=v;return o};return o};c.models.legend=function(){var h={top:5,right:0,bottom:5,left:0},f=400,n=20,j=function(p){return p.key},i=c.utils.defaultColor(),l=true,g=true,o=true,e=false,k=d3.dispatch("legendClick","legendDblclick","legendMouseover","legendMouseout","stateChange");function m(p){p.each(function(J){var q=f-h.left-h.right,B=d3.select(this);var z=B.selectAll("g.nv-legend").data([J]);var F=z.enter().append("g").attr("class","nvd3 nv-legend").append("g");var I=z.select("g");z.attr("transform","translate("+h.left+","+h.top+")");var A=I.selectAll(".nv-series").data(function(K){return K});var u=A.enter().append("g").attr("class","nv-series").on("mouseover",function(L,K){k.legendMouseover(L,K)}).on("mouseout",function(L,K){k.legendMouseout(L,K)}).on("click",function(L,K){k.legendClick(L,K);if(o){if(e){J.forEach(function(M){M.disabled=true});L.disabled=false}else{L.disabled=!L.disabled;if(J.every(function(M){return M.disabled})){J.forEach(function(M){M.disabled=false})}}k.stateChange({disabled:J.map(function(M){return !!M.disabled})})}}).on("dblclick",function(L,K){k.legendDblclick(L,K);if(o){J.forEach(function(M){M.disabled=true});L.disabled=false;k.stateChange({disabled:J.map(function(M){return !!M.disabled})})}});u.append("circle").style("stroke-width",2).attr("class","nv-legend-symbol").attr("r",5);u.append("text").attr("text-anchor","start").attr("class","nv-legend-text").attr("dy",".32em").attr("dx","8");A.classed("disabled",function(K){return K.disabled});A.exit().remove();A.select("circle").style("fill",function(L,K){return L.color||i(L,K)}).style("stroke",function(L,K){return L.color||i(L,K)});A.select("text").text(j);if(l){var t=[];A.each(function(O,M){var L=d3.select(this).select("text");var K;try{K=L.node().getComputedTextLength()}catch(N){K=c.utils.calcApproxTextWidth(L)}t.push(K+28)});var x=0;var E=0;var C=[];while(Eq&&x>1){C=[];x--;for(var G=0;G(C[G%x]||0)){C[G%x]=t[G]}}E=C.reduce(function(L,M,K,N){return L+M})}var r=[];for(var H=0,y=0;HD){D=w}return"translate("+s+","+v+")"});I.attr("transform","translate("+(f-h.right-D)+","+h.top+")");n=h.top+h.bottom+v+15}});return m}m.dispatch=k;m.options=c.utils.optionsFunc.bind(m);m.margin=function(p){if(!arguments.length){return h}h.top=typeof p.top!="undefined"?p.top:h.top;h.right=typeof p.right!="undefined"?p.right:h.right;h.bottom=typeof p.bottom!="undefined"?p.bottom:h.bottom;h.left=typeof p.left!="undefined"?p.left:h.left;return m};m.width=function(p){if(!arguments.length){return f}f=p;return m};m.height=function(p){if(!arguments.length){return n}n=p;return m};m.key=function(p){if(!arguments.length){return j}j=p;return m};m.color=function(p){if(!arguments.length){return i}i=c.utils.getColor(p);return m};m.align=function(p){if(!arguments.length){return l}l=p;return m};m.rightAlign=function(p){if(!arguments.length){return g}g=p;return m};m.updateState=function(p){if(!arguments.length){return o}o=p;return m};m.radioButtonMode=function(p){if(!arguments.length){return e}e=p;return m};return m};c.models.line=function(){var e=c.models.scatter();var i={top:0,right:0,bottom:0,left:0},f=960,t=500,j=c.utils.defaultColor(),s=function(u){return u.x},r=function(u){return u.y},h=function(v,u){return !isNaN(r(v,u))&&r(v,u)!==null},m=function(u){return u.area},q=false,o,n,k="linear";e.size(16).sizeDomain([16,256]);var g,p;function l(u){u.each(function(E){var H=f-i.left-i.right,z=t-i.top-i.bottom,w=d3.select(this);o=e.xScale();n=e.yScale();g=g||o;p=p||n;var x=w.selectAll("g.nv-wrap.nv-line").data([E]);var C=x.enter().append("g").attr("class","nvd3 nv-wrap nv-line");var A=C.append("defs");var v=C.append("g");var F=x.select("g");v.append("g").attr("class","nv-groups");v.append("g").attr("class","nv-scatterWrap");x.attr("transform","translate("+i.left+","+i.top+")");e.width(H).height(z);var y=x.select(".nv-scatterWrap");y.transition().call(e);A.append("clipPath").attr("id","nv-edge-clip-"+e.id()).append("rect");x.select("#nv-edge-clip-"+e.id()+" rect").attr("width",H).attr("height",z);F.attr("clip-path",q?"url(#nv-edge-clip-"+e.id()+")":"");y.attr("clip-path",q?"url(#nv-edge-clip-"+e.id()+")":"");var B=x.select(".nv-groups").selectAll(".nv-group").data(function(I){return I},function(I){return I.key});B.enter().append("g").style("stroke-opacity",0.000001).style("fill-opacity",0.000001);B.exit().transition().style("stroke-opacity",0.000001).style("fill-opacity",0.000001).remove();B.attr("class",function(J,I){return"nv-group nv-series-"+I}).classed("hover",function(I){return I.hover}).style("fill",function(J,I){return j(J,I)}).style("stroke",function(J,I){return j(J,I)});B.transition().style("stroke-opacity",1).style("fill-opacity",0.5);var G=B.selectAll("path.nv-area").data(function(I){return m(I)?[I]:[]});G.enter().append("path").attr("class","nv-area").attr("d",function(I){return d3.svg.area().interpolate(k).defined(h).x(function(K,J){return c.utils.NaNtoZero(g(s(K,J)))}).y0(function(K,J){return c.utils.NaNtoZero(p(r(K,J)))}).y1(function(K,J){return p(n.domain()[0]<=0?n.domain()[1]>=0?0:n.domain()[1]:n.domain()[0])}).apply(this,[I.values])});B.exit().selectAll("path.nv-area").remove();G.transition().attr("d",function(I){return d3.svg.area().interpolate(k).defined(h).x(function(K,J){return c.utils.NaNtoZero(o(s(K,J)))}).y0(function(K,J){return c.utils.NaNtoZero(n(r(K,J)))}).y1(function(K,J){return n(n.domain()[0]<=0?n.domain()[1]>=0?0:n.domain()[1]:n.domain()[0])}).apply(this,[I.values])});var D=B.selectAll("path.nv-line").data(function(I){return[I.values]});D.enter().append("path").attr("class","nv-line").attr("d",d3.svg.line().interpolate(k).defined(h).x(function(J,I){return c.utils.NaNtoZero(g(s(J,I)))}).y(function(J,I){return c.utils.NaNtoZero(p(r(J,I)))}));B.exit().selectAll("path.nv-line").transition().attr("d",d3.svg.line().interpolate(k).defined(h).x(function(J,I){return c.utils.NaNtoZero(o(s(J,I)))}).y(function(J,I){return c.utils.NaNtoZero(n(r(J,I)))}));D.transition().attr("d",d3.svg.line().interpolate(k).defined(h).x(function(J,I){return c.utils.NaNtoZero(o(s(J,I)))}).y(function(J,I){return c.utils.NaNtoZero(n(r(J,I)))}));g=o.copy();p=n.copy()});return l}l.dispatch=e.dispatch;l.scatter=e;d3.rebind(l,e,"id","interactive","size","xScale","yScale","zScale","xDomain","yDomain","xRange","yRange","sizeDomain","forceX","forceY","forceSize","clipVoronoi","useVoronoi","clipRadius","padData","highlightPoint","clearHighlights");l.options=c.utils.optionsFunc.bind(l);l.margin=function(u){if(!arguments.length){return i}i.top=typeof u.top!="undefined"?u.top:i.top;i.right=typeof u.right!="undefined"?u.right:i.right;i.bottom=typeof u.bottom!="undefined"?u.bottom:i.bottom;i.left=typeof u.left!="undefined"?u.left:i.left;return l};l.width=function(u){if(!arguments.length){return f}f=u;return l};l.height=function(u){if(!arguments.length){return t}t=u;return l};l.x=function(u){if(!arguments.length){return s}s=u;e.x(u);return l};l.y=function(u){if(!arguments.length){return r}r=u;e.y(u);return l};l.clipEdge=function(u){if(!arguments.length){return q}q=u;return l};l.color=function(u){if(!arguments.length){return j}j=c.utils.getColor(u);e.color(j);return l};l.interpolate=function(u){if(!arguments.length){return k}k=u;return l};l.defined=function(u){if(!arguments.length){return h}h=u;return l};l.isArea=function(u){if(!arguments.length){return m}m=d3.functor(u);return l};return l};c.models.lineChart=function(){var f=c.models.line(),o=c.models.axis(),e=c.models.axis(),h=c.models.legend(),z=c.interactiveGuideline();var v={top:30,right:20,bottom:50,left:60},B=c.utils.defaultColor(),A=null,w=null,C=true,D=true,s=true,n=false,r=false,g=true,l=function(G,F,J,I,H){return"

"+G+"

"+J+" at "+F+"

"},q,p,k={},m=null,j="No Data Available.",E=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),t=250;o.orient("bottom").tickPadding(7);e.orient((n)?"right":"left");var i=function(K,G){var J=K.pos[0]+(G.offsetLeft||0),I=K.pos[1]+(G.offsetTop||0),F=o.tickFormat()(f.x()(K.point,K.pointIndex)),L=e.tickFormat()(f.y()(K.point,K.pointIndex)),H=l(K.series.key,F,L,K,u);c.tooltip.show([J,I],H,null,null,G)};function u(x){x.each(function(K){var G=d3.select(this),M=this;var O=(A||parseInt(G.style("width"))||960)-v.left-v.right,J=(w||parseInt(G.style("height"))||400)-v.top-v.bottom;u.update=function(){G.transition().duration(t).call(u)};u.container=this;k.disabled=K.map(function(P){return !!P.disabled});if(!m){var N;m={};for(N in k){if(k[N] instanceof Array){m[N]=k[N].slice(0)}else{m[N]=k[N]}}}if(!K||!K.length||!K.filter(function(P){return P.values.length}).length){var H=G.selectAll(".nv-noData").data([j]);H.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle");H.attr("x",v.left+O/2).attr("y",v.top+J/2).text(function(P){return P});return u}else{G.selectAll(".nv-noData").remove()}q=f.xScale();p=f.yScale();var I=G.selectAll("g.nv-wrap.nv-lineChart").data([K]);var y=I.enter().append("g").attr("class","nvd3 nv-wrap nv-lineChart").append("g");var L=I.select("g");y.append("rect").style("opacity",0);y.append("g").attr("class","nv-x nv-axis");y.append("g").attr("class","nv-y nv-axis");y.append("g").attr("class","nv-linesWrap");y.append("g").attr("class","nv-legendWrap");y.append("g").attr("class","nv-interactive");L.select("rect").attr("width",O).attr("height",J);if(C){h.width(O);L.select(".nv-legendWrap").datum(K).call(h);if(v.top!=h.height()){v.top=h.height();J=(w||parseInt(G.style("height"))||400)-v.top-v.bottom}I.select(".nv-legendWrap").attr("transform","translate(0,"+(-v.top)+")")}I.attr("transform","translate("+v.left+","+v.top+")");if(n){L.select(".nv-y.nv-axis").attr("transform","translate("+O+",0)")}if(r){z.width(O).height(J).margin({left:v.left,top:v.top}).svgContainer(G).xScale(q);I.select(".nv-interactive").call(z)}f.width(O).height(J).color(K.map(function(Q,P){return Q.color||B(Q,P)}).filter(function(Q,P){return !K[P].disabled}));var F=L.select(".nv-linesWrap").datum(K.filter(function(P){return !P.disabled}));F.transition().call(f);if(D){o.scale(q).ticks(O/100).tickSize(-J,0);L.select(".nv-x.nv-axis").attr("transform","translate(0,"+p.range()[0]+")");L.select(".nv-x.nv-axis").transition().call(o)}if(s){e.scale(p).ticks(J/36).tickSize(-O,0);L.select(".nv-y.nv-axis").transition().call(e)}h.dispatch.on("stateChange",function(P){k=P;E.stateChange(k);u.update()});z.dispatch.on("elementMousemove",function(U){f.clearHighlights();var T,S,P,R=[];K.filter(function(W,V){W.seriesIndex=V;return !W.disabled}).forEach(function(X,W){S=c.interactiveBisect(X.values,U.pointXValue,u.x());f.highlightPoint(W,S,true);var V=X.values[S];if(typeof V==="undefined"){return}if(typeof T==="undefined"){T=V}if(typeof P==="undefined"){P=u.xScale()(u.x()(V,S))}R.push({key:X.key,value:u.y()(V,S),color:B(X,X.seriesIndex)})});var Q=o.tickFormat()(u.x()(T,S));z.tooltip.position({left:P+v.left,top:U.mouseY+v.top}).chartContainer(M.parentNode).enabled(g).valueFormatter(function(W,V){return e.tickFormat()(W)}).data({value:Q,series:R})();z.renderGuideLine(P)});z.dispatch.on("elementMouseout",function(P){E.tooltipHide();f.clearHighlights()});E.on("tooltipShow",function(P){if(g){i(P,M.parentNode)}});E.on("changeState",function(P){if(typeof P.disabled!=="undefined"){K.forEach(function(R,Q){R.disabled=P.disabled[Q]});k.disabled=P.disabled}u.update()})});return u}f.dispatch.on("elementMouseover.tooltip",function(x){x.pos=[x.pos[0]+v.left,x.pos[1]+v.top];E.tooltipShow(x)});f.dispatch.on("elementMouseout.tooltip",function(x){E.tooltipHide(x)});E.on("tooltipHide",function(){if(g){c.tooltip.cleanup()}});u.dispatch=E;u.lines=f;u.legend=h;u.xAxis=o;u.yAxis=e;u.interactiveLayer=z;d3.rebind(u,f,"defined","isArea","x","y","size","xScale","yScale","xDomain","yDomain","xRange","yRange","forceX","forceY","interactive","clipEdge","clipVoronoi","useVoronoi","id","interpolate");u.options=c.utils.optionsFunc.bind(u);u.margin=function(x){if(!arguments.length){return v}v.top=typeof x.top!="undefined"?x.top:v.top;v.right=typeof x.right!="undefined"?x.right:v.right;v.bottom=typeof x.bottom!="undefined"?x.bottom:v.bottom;v.left=typeof x.left!="undefined"?x.left:v.left;return u};u.width=function(x){if(!arguments.length){return A}A=x;return u};u.height=function(x){if(!arguments.length){return w}w=x;return u};u.color=function(x){if(!arguments.length){return B}B=c.utils.getColor(x);h.color(B);return u};u.showLegend=function(x){if(!arguments.length){return C}C=x;return u};u.showXAxis=function(x){if(!arguments.length){return D}D=x;return u};u.showYAxis=function(x){if(!arguments.length){return s}s=x;return u};u.rightAlignYAxis=function(x){if(!arguments.length){return n}n=x;e.orient((x)?"right":"left");return u};u.useInteractiveGuideline=function(x){if(!arguments.length){return r}r=x;if(x===true){u.interactive(false);u.useVoronoi(false)}return u};u.tooltip=function(x){if(!arguments.length){return l}l=x;return u};u.tooltips=function(x){if(!arguments.length){return g}g=x;return u};u.tooltipContent=function(x){if(!arguments.length){return l}l=x;return u};u.state=function(x){if(!arguments.length){return k}k=x;return u};u.defaultState=function(x){if(!arguments.length){return m}m=x;return u};u.noData=function(x){if(!arguments.length){return j}j=x;return u};u.transitionDuration=function(x){if(!arguments.length){return t}t=x;return u};return u};c.models.linePlusBarChart=function(){var e=c.models.line(),v=c.models.historicalBar(),p=c.models.axis(),r=c.models.axis(),h=c.models.axis(),g=c.models.legend();var t={top:30,right:60,bottom:50,left:60},w=null,u=null,A=function(x){return x.x},z=function(x){return x.y},y=c.utils.defaultColor(),B=true,f=true,n=function(E,D,H,G,F){return"

"+E+"

"+H+" at "+D+"

"},q,j,i,m={},o=null,l="No Data Available.",C=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState");v.padData(true);e.clipEdge(false).padData(true);p.orient("bottom").tickPadding(7).highlightZero(false);r.orient("left");h.orient("right");var k=function(I,E){var H=I.pos[0]+(E.offsetLeft||0),G=I.pos[1]+(E.offsetTop||0),D=p.tickFormat()(e.x()(I.point,I.pointIndex)),J=(I.series.bar?r:h).tickFormat()(e.y()(I.point,I.pointIndex)),F=n(I.series.key,D,J,I,s);c.tooltip.show([H,G],F,I.value<0?"n":"s",null,E)};function s(x){x.each(function(K){var F=d3.select(this),N=this;var P=(w||parseInt(F.style("width"))||960)-t.left-t.right,I=(u||parseInt(F.style("height"))||400)-t.top-t.bottom;s.update=function(){F.transition().call(s)};m.disabled=K.map(function(R){return !!R.disabled});if(!o){var O;o={};for(O in m){if(m[O] instanceof Array){o[O]=m[O].slice(0)}else{o[O]=m[O]}}}if(!K||!K.length||!K.filter(function(R){return R.values.length}).length){var G=F.selectAll(".nv-noData").data([l]);G.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle");G.attr("x",t.left+P/2).attr("y",t.top+I/2).text(function(R){return R});return s}else{F.selectAll(".nv-noData").remove()}var Q=K.filter(function(R){return !R.disabled&&R.bar});var J=K.filter(function(R){return !R.bar});q=J.filter(function(R){return !R.disabled}).length&&J.filter(function(R){return !R.disabled})[0].values.length?e.xScale():v.xScale();j=v.yScale();i=e.yScale();var H=d3.select(this).selectAll("g.nv-wrap.nv-linePlusBar").data([K]);var D=H.enter().append("g").attr("class","nvd3 nv-wrap nv-linePlusBar").append("g");var L=H.select("g");D.append("g").attr("class","nv-x nv-axis");D.append("g").attr("class","nv-y1 nv-axis");D.append("g").attr("class","nv-y2 nv-axis");D.append("g").attr("class","nv-barsWrap");D.append("g").attr("class","nv-linesWrap");D.append("g").attr("class","nv-legendWrap");if(B){g.width(P/2);L.select(".nv-legendWrap").datum(K.map(function(R){R.originalKey=R.originalKey===undefined?R.key:R.originalKey;R.key=R.originalKey+(R.bar?" (left axis)":" (right axis)");return R})).call(g);if(t.top!=g.height()){t.top=g.height();I=(u||parseInt(F.style("height"))||400)-t.top-t.bottom}L.select(".nv-legendWrap").attr("transform","translate("+(P/2)+","+(-t.top)+")")}H.attr("transform","translate("+t.left+","+t.top+")");e.width(P).height(I).color(K.map(function(S,R){return S.color||y(S,R)}).filter(function(S,R){return !K[R].disabled&&!K[R].bar}));v.width(P).height(I).color(K.map(function(S,R){return S.color||y(S,R)}).filter(function(S,R){return !K[R].disabled&&K[R].bar}));var M=L.select(".nv-barsWrap").datum(Q.length?Q:[{values:[]}]);var E=L.select(".nv-linesWrap").datum(J[0]&&!J[0].disabled?J:[{values:[]}]);d3.transition(M).call(v);d3.transition(E).call(e);p.scale(q).ticks(P/100).tickSize(-I,0);L.select(".nv-x.nv-axis").attr("transform","translate(0,"+j.range()[0]+")");d3.transition(L.select(".nv-x.nv-axis")).call(p);r.scale(j).ticks(I/36).tickSize(-P,0);d3.transition(L.select(".nv-y1.nv-axis")).style("opacity",Q.length?1:0).call(r);h.scale(i).ticks(I/36).tickSize(Q.length?0:-P,0);L.select(".nv-y2.nv-axis").style("opacity",J.length?1:0).attr("transform","translate("+P+",0)");d3.transition(L.select(".nv-y2.nv-axis")).call(h);g.dispatch.on("stateChange",function(R){m=R;C.stateChange(m);s.update()});C.on("tooltipShow",function(R){if(f){k(R,N.parentNode)}});C.on("changeState",function(R){if(typeof R.disabled!=="undefined"){K.forEach(function(T,S){T.disabled=R.disabled[S]});m.disabled=R.disabled}s.update()})});return s}e.dispatch.on("elementMouseover.tooltip",function(x){x.pos=[x.pos[0]+t.left,x.pos[1]+t.top];C.tooltipShow(x)});e.dispatch.on("elementMouseout.tooltip",function(x){C.tooltipHide(x)});v.dispatch.on("elementMouseover.tooltip",function(x){x.pos=[x.pos[0]+t.left,x.pos[1]+t.top];C.tooltipShow(x)});v.dispatch.on("elementMouseout.tooltip",function(x){C.tooltipHide(x)});C.on("tooltipHide",function(){if(f){c.tooltip.cleanup()}});s.dispatch=C;s.legend=g;s.lines=e;s.bars=v;s.xAxis=p;s.y1Axis=r;s.y2Axis=h;d3.rebind(s,e,"defined","size","clipVoronoi","interpolate");s.options=c.utils.optionsFunc.bind(s);s.x=function(x){if(!arguments.length){return A}A=x;e.x(x);v.x(x);return s};s.y=function(x){if(!arguments.length){return z}z=x;e.y(x);v.y(x);return s};s.margin=function(x){if(!arguments.length){return t}t.top=typeof x.top!="undefined"?x.top:t.top;t.right=typeof x.right!="undefined"?x.right:t.right;t.bottom=typeof x.bottom!="undefined"?x.bottom:t.bottom;t.left=typeof x.left!="undefined"?x.left:t.left;return s};s.width=function(x){if(!arguments.length){return w}w=x;return s};s.height=function(x){if(!arguments.length){return u}u=x;return s};s.color=function(x){if(!arguments.length){return y}y=c.utils.getColor(x);g.color(y);return s};s.showLegend=function(x){if(!arguments.length){return B}B=x;return s};s.tooltips=function(x){if(!arguments.length){return f}f=x;return s};s.tooltipContent=function(x){if(!arguments.length){return n}n=x;return s};s.state=function(x){if(!arguments.length){return m}m=x;return s};s.defaultState=function(x){if(!arguments.length){return o}o=x;return s};s.noData=function(x){if(!arguments.length){return l}l=x;return s};return s};c.models.lineWithFocusChart=function(){var g=c.models.line(),p=c.models.line(),q=c.models.axis(),e=c.models.axis(),G=c.models.axis(),j=c.models.axis(),h=c.models.legend(),i=d3.svg.brush();var z={top:30,right:30,bottom:30,left:60},t={top:0,right:30,bottom:20,left:60},C=c.utils.defaultColor(),B=null,A=null,n=100,s,r,D,k,E=true,v=null,f=true,o=function(I,H,L,K,J){return"

"+I+"

"+L+" at "+H+"

"},m="No Data Available.",F=d3.dispatch("tooltipShow","tooltipHide","brush"),u=250;g.clipEdge(true);p.interactive(false);q.orient("bottom").tickPadding(5);e.orient("left");G.orient("bottom").tickPadding(5);j.orient("left");var l=function(M,I){var L=M.pos[0]+(I.offsetLeft||0),K=M.pos[1]+(I.offsetTop||0),H=q.tickFormat()(g.x()(M.point,M.pointIndex)),N=e.tickFormat()(g.y()(M.point,M.pointIndex)),J=o(M.series.key,H,N,M,w);c.tooltip.show([L,K],J,null,null,I)};function w(x){x.each(function(Y){var P=d3.select(this),L=this;var y=(B||parseInt(P.style("width"))||960)-z.left-z.right,M=(A||parseInt(P.style("height"))||400)-z.top-z.bottom-n,K=n-t.top-t.bottom;w.update=function(){P.transition().duration(u).call(w)};w.container=this;if(!Y||!Y.length||!Y.filter(function(Z){return Z.values.length}).length){var O=P.selectAll(".nv-noData").data([m]);O.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle");O.attr("x",z.left+y/2).attr("y",z.top+M/2).text(function(Z){return Z});return w}else{P.selectAll(".nv-noData").remove()}s=g.xScale();r=g.yScale();D=p.xScale();k=p.yScale();var N=P.selectAll("g.nv-wrap.nv-lineWithFocusChart").data([Y]);var S=N.enter().append("g").attr("class","nvd3 nv-wrap nv-lineWithFocusChart").append("g");var U=N.select("g");S.append("g").attr("class","nv-legendWrap");var J=S.append("g").attr("class","nv-focus");J.append("g").attr("class","nv-x nv-axis");J.append("g").attr("class","nv-y nv-axis");J.append("g").attr("class","nv-linesWrap");var H=S.append("g").attr("class","nv-context");H.append("g").attr("class","nv-x nv-axis");H.append("g").attr("class","nv-y nv-axis");H.append("g").attr("class","nv-linesWrap");H.append("g").attr("class","nv-brushBackground");H.append("g").attr("class","nv-x nv-brush");if(E){h.width(y);U.select(".nv-legendWrap").datum(Y).call(h);if(z.top!=h.height()){z.top=h.height();M=(A||parseInt(P.style("height"))||400)-z.top-z.bottom-n}U.select(".nv-legendWrap").attr("transform","translate(0,"+(-z.top)+")")}N.attr("transform","translate("+z.left+","+z.top+")");g.width(y).height(M).color(Y.map(function(aa,Z){return aa.color||C(aa,Z)}).filter(function(aa,Z){return !Y[Z].disabled}));p.defined(g.defined()).width(y).height(K).color(Y.map(function(aa,Z){return aa.color||C(aa,Z)}).filter(function(aa,Z){return !Y[Z].disabled}));U.select(".nv-context").attr("transform","translate(0,"+(M+z.bottom+t.top)+")");var I=U.select(".nv-context .nv-linesWrap").datum(Y.filter(function(Z){return !Z.disabled}));d3.transition(I).call(p);q.scale(s).ticks(y/100).tickSize(-M,0);e.scale(r).ticks(M/36).tickSize(-y,0);U.select(".nv-focus .nv-x.nv-axis").attr("transform","translate(0,"+M+")");i.x(D).on("brush",function(){var Z=w.transitionDuration();w.transitionDuration(0);R();w.transitionDuration(Z)});if(v){i.extent(v)}var W=U.select(".nv-brushBackground").selectAll("g").data([v||i.extent()]);var V=W.enter().append("g");V.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",K);V.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",K);var X=U.select(".nv-x.nv-brush").call(i);X.selectAll("rect").attr("height",K);X.selectAll(".resize").append("path").attr("d",Q);R();G.scale(D).ticks(y/100).tickSize(-K,0);U.select(".nv-context .nv-x.nv-axis").attr("transform","translate(0,"+k.range()[0]+")");d3.transition(U.select(".nv-context .nv-x.nv-axis")).call(G);j.scale(k).ticks(K/36).tickSize(-y,0);d3.transition(U.select(".nv-context .nv-y.nv-axis")).call(j);U.select(".nv-context .nv-x.nv-axis").attr("transform","translate(0,"+k.range()[0]+")");h.dispatch.on("stateChange",function(Z){w.update()});F.on("tooltipShow",function(Z){if(f){l(Z,L.parentNode)}});function Q(ab){var aa=+(ab=="e"),Z=aa?1:-1,ac=K/3;return"M"+(0.5*Z)+","+ac+"A6,6 0 0 "+aa+" "+(6.5*Z)+","+(ac+6)+"V"+(2*ac-6)+"A6,6 0 0 "+aa+" "+(0.5*Z)+","+(2*ac)+"ZM"+(2.5*Z)+","+(ac+8)+"V"+(2*ac-8)+"M"+(4.5*Z)+","+(ac+8)+"V"+(2*ac-8)}function T(){if(!i.empty()){i.extent(v)}W.data([i.empty()?D.domain():v]).each(function(ac,Z){var aa=D(ac[0])-s.range()[0],ab=s.range()[1]-D(ac[1]);d3.select(this).select(".left").attr("width",aa<0?0:aa);d3.select(this).select(".right").attr("x",D(ac[1])).attr("width",ab<0?0:ab)})}function R(){v=i.empty()?null:i.extent();var aa=i.empty()?D.domain():i.extent();if(Math.abs(aa[0]-aa[1])<=1){return}F.brush({extent:aa,brush:i});T();var Z=U.select(".nv-focus .nv-linesWrap").datum(Y.filter(function(ab){return !ab.disabled}).map(function(ac,ab){return{key:ac.key,values:ac.values.filter(function(ae,ad){return g.x()(ae,ad)>=aa[0]&&g.x()(ae,ad)<=aa[1]})}}));Z.transition().duration(u).call(g);U.select(".nv-focus .nv-x.nv-axis").transition().duration(u).call(q);U.select(".nv-focus .nv-y.nv-axis").transition().duration(u).call(e)}});return w}g.dispatch.on("elementMouseover.tooltip",function(x){x.pos=[x.pos[0]+z.left,x.pos[1]+z.top];F.tooltipShow(x)});g.dispatch.on("elementMouseout.tooltip",function(x){F.tooltipHide(x)});F.on("tooltipHide",function(){if(f){c.tooltip.cleanup()}});w.dispatch=F;w.legend=h;w.lines=g;w.lines2=p;w.xAxis=q;w.yAxis=e;w.x2Axis=G;w.y2Axis=j;d3.rebind(w,g,"defined","isArea","size","xDomain","yDomain","xRange","yRange","forceX","forceY","interactive","clipEdge","clipVoronoi","id");w.options=c.utils.optionsFunc.bind(w);w.x=function(x){if(!arguments.length){return g.x}g.x(x);p.x(x);return w};w.y=function(x){if(!arguments.length){return g.y}g.y(x);p.y(x);return w};w.margin=function(x){if(!arguments.length){return z}z.top=typeof x.top!="undefined"?x.top:z.top;z.right=typeof x.right!="undefined"?x.right:z.right;z.bottom=typeof x.bottom!="undefined"?x.bottom:z.bottom;z.left=typeof x.left!="undefined"?x.left:z.left;return w};w.margin2=function(x){if(!arguments.length){return t}t=x;return w};w.width=function(x){if(!arguments.length){return B}B=x;return w};w.height=function(x){if(!arguments.length){return A}A=x;return w};w.height2=function(x){if(!arguments.length){return n}n=x;return w};w.color=function(x){if(!arguments.length){return C}C=c.utils.getColor(x);h.color(C);return w};w.showLegend=function(x){if(!arguments.length){return E}E=x;return w};w.tooltips=function(x){if(!arguments.length){return f}f=x;return w};w.tooltipContent=function(x){if(!arguments.length){return o}o=x;return w};w.interpolate=function(x){if(!arguments.length){return g.interpolate()}g.interpolate(x);p.interpolate(x);return w};w.noData=function(x){if(!arguments.length){return m}m=x;return w};w.xTickFormat=function(x){if(!arguments.length){return q.tickFormat()}q.tickFormat(x);G.tickFormat(x);return w};w.yTickFormat=function(x){if(!arguments.length){return e.tickFormat()}e.tickFormat(x);j.tickFormat(x);return w};w.brushExtent=function(x){if(!arguments.length){return v}v=x;return w};w.transitionDuration=function(x){if(!arguments.length){return u}u=x;return w};return w};c.models.linePlusBarWithFocusChart=function(){var v=c.models.line(),o=c.models.line(),u=c.models.historicalBar(),A=c.models.historicalBar(),p=c.models.axis(),t=c.models.axis(),m=c.models.axis(),g=c.models.axis(),E=c.models.axis(),r=c.models.axis(),z=c.models.legend(),G=d3.svg.brush();var i={top:30,right:30,bottom:30,left:60},H={top:0,right:30,bottom:20,left:60},e=null,f=null,q=100,F=function(x){return x.x},D=function(x){return x.y},s=c.utils.defaultColor(),n=true,h,j=null,C=true,w=function(Q,P,T,S,R){return"

"+Q+"

"+T+" at "+P+"

"},y,l,O,M,L,K,k="No Data Available.",B=d3.dispatch("tooltipShow","tooltipHide","brush"),I=0;v.clipEdge(true);o.interactive(false);p.orient("bottom").tickPadding(5);m.orient("left");g.orient("right");t.orient("bottom").tickPadding(5);E.orient("left");r.orient("right");var N=function(U,Q){if(h){U.pointIndex+=Math.ceil(h[0])}var T=U.pos[0]+(Q.offsetLeft||0),S=U.pos[1]+(Q.offsetTop||0),P=p.tickFormat()(v.x()(U.point,U.pointIndex)),V=(U.series.bar?m:g).tickFormat()(v.y()(U.point,U.pointIndex)),R=w(U.series.key,P,V,U,J);c.tooltip.show([T,S],R,U.value<0?"n":"s",null,Q)};function J(x){x.each(function(am){var aa=d3.select(this),U=this;var P=(e||parseInt(aa.style("width"))||960)-i.left-i.right,V=(f||parseInt(aa.style("height"))||400)-i.top-i.bottom-q,T=q-H.top-H.bottom;J.update=function(){aa.transition().duration(I).call(J)};J.container=this;if(!am||!am.length||!am.filter(function(an){return an.values.length}).length){var Z=aa.selectAll(".nv-noData").data([k]);Z.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle");Z.attr("x",i.left+P/2).attr("y",i.top+V/2).text(function(an){return an});return J}else{aa.selectAll(".nv-noData").remove()}var Q=am.filter(function(an){return !an.disabled&&an.bar});var ag=am.filter(function(an){return !an.bar});y=u.xScale();l=t.scale();O=u.yScale();M=v.yScale();L=A.yScale();K=o.yScale();var X=am.filter(function(an){return !an.disabled&&an.bar}).map(function(an){return an.values.map(function(ap,ao){return{x:F(ap,ao),y:D(ap,ao)}})});var W=am.filter(function(an){return !an.disabled&&!an.bar}).map(function(an){return an.values.map(function(ap,ao){return{x:F(ap,ao),y:D(ap,ao)}})});y.range([0,P]);l.domain(d3.extent(d3.merge(X.concat(W)),function(an){return an.x})).range([0,P]);var Y=aa.selectAll("g.nv-wrap.nv-linePlusBar").data([am]);var ad=Y.enter().append("g").attr("class","nvd3 nv-wrap nv-linePlusBar").append("g");var ah=Y.select("g");ad.append("g").attr("class","nv-legendWrap");var S=ad.append("g").attr("class","nv-focus");S.append("g").attr("class","nv-x nv-axis");S.append("g").attr("class","nv-y1 nv-axis");S.append("g").attr("class","nv-y2 nv-axis");S.append("g").attr("class","nv-barsWrap");S.append("g").attr("class","nv-linesWrap");var R=ad.append("g").attr("class","nv-context");R.append("g").attr("class","nv-x nv-axis");R.append("g").attr("class","nv-y1 nv-axis");R.append("g").attr("class","nv-y2 nv-axis");R.append("g").attr("class","nv-barsWrap");R.append("g").attr("class","nv-linesWrap");R.append("g").attr("class","nv-brushBackground");R.append("g").attr("class","nv-x nv-brush");if(n){z.width(P/2);ah.select(".nv-legendWrap").datum(am.map(function(an){an.originalKey=an.originalKey===undefined?an.key:an.originalKey;an.key=an.originalKey+(an.bar?" (left axis)":" (right axis)");return an})).call(z);if(i.top!=z.height()){i.top=z.height();V=(f||parseInt(aa.style("height"))||400)-i.top-i.bottom-q}ah.select(".nv-legendWrap").attr("transform","translate("+(P/2)+","+(-i.top)+")")}Y.attr("transform","translate("+i.left+","+i.top+")");A.width(P).height(T).color(am.map(function(ao,an){return ao.color||s(ao,an)}).filter(function(ao,an){return !am[an].disabled&&am[an].bar}));o.width(P).height(T).color(am.map(function(ao,an){return ao.color||s(ao,an)}).filter(function(ao,an){return !am[an].disabled&&!am[an].bar}));var ai=ah.select(".nv-context .nv-barsWrap").datum(Q.length?Q:[{values:[]}]);var af=ah.select(".nv-context .nv-linesWrap").datum(!ag[0].disabled?ag:[{values:[]}]);ah.select(".nv-context").attr("transform","translate(0,"+(V+i.bottom+H.top)+")");ai.transition().call(A);af.transition().call(o);G.x(l).on("brush",ac);if(j){G.extent(j)}var al=ah.select(".nv-brushBackground").selectAll("g").data([j||G.extent()]);var aj=al.enter().append("g");aj.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",T);aj.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",T);var ak=ah.select(".nv-x.nv-brush").call(G);ak.selectAll("rect").attr("height",T);ak.selectAll(".resize").append("path").attr("d",ab);t.ticks(P/100).tickSize(-T,0);ah.select(".nv-context .nv-x.nv-axis").attr("transform","translate(0,"+L.range()[0]+")");ah.select(".nv-context .nv-x.nv-axis").transition().call(t);E.scale(L).ticks(T/36).tickSize(-P,0);ah.select(".nv-context .nv-y1.nv-axis").style("opacity",Q.length?1:0).attr("transform","translate(0,"+l.range()[0]+")");ah.select(".nv-context .nv-y1.nv-axis").transition().call(E);r.scale(K).ticks(T/36).tickSize(Q.length?0:-P,0);ah.select(".nv-context .nv-y2.nv-axis").style("opacity",ag.length?1:0).attr("transform","translate("+l.range()[1]+",0)");ah.select(".nv-context .nv-y2.nv-axis").transition().call(r);z.dispatch.on("stateChange",function(an){J.update()});B.on("tooltipShow",function(an){if(C){N(an,U.parentNode)}});function ab(ap){var ao=+(ap=="e"),an=ao?1:-1,aq=T/3;return"M"+(0.5*an)+","+aq+"A6,6 0 0 "+ao+" "+(6.5*an)+","+(aq+6)+"V"+(2*aq-6)+"A6,6 0 0 "+ao+" "+(0.5*an)+","+(2*aq)+"ZM"+(2.5*an)+","+(aq+8)+"V"+(2*aq-8)+"M"+(4.5*an)+","+(aq+8)+"V"+(2*aq-8)}function ae(){if(!G.empty()){G.extent(j)}al.data([G.empty()?l.domain():j]).each(function(aq,an){var ao=l(aq[0])-l.range()[0],ap=l.range()[1]-l(aq[1]);d3.select(this).select(".left").attr("width",ao<0?0:ao);d3.select(this).select(".right").attr("x",l(aq[1])).attr("width",ap<0?0:ap)})}function ac(){j=G.empty()?null:G.extent();h=G.empty()?l.domain():G.extent();B.brush({extent:h,brush:G});ae();u.width(P).height(V).color(am.map(function(aq,ap){return aq.color||s(aq,ap)}).filter(function(aq,ap){return !am[ap].disabled&&am[ap].bar}));v.width(P).height(V).color(am.map(function(aq,ap){return aq.color||s(aq,ap)}).filter(function(aq,ap){return !am[ap].disabled&&!am[ap].bar}));var ao=ah.select(".nv-focus .nv-barsWrap").datum(!Q.length?[{values:[]}]:Q.map(function(aq,ap){return{key:aq.key,values:aq.values.filter(function(at,ar){return u.x()(at,ar)>=h[0]&&u.x()(at,ar)<=h[1]})}}));var an=ah.select(".nv-focus .nv-linesWrap").datum(ag[0].disabled?[{values:[]}]:ag.map(function(aq,ap){return{key:aq.key,values:aq.values.filter(function(at,ar){return v.x()(at,ar)>=h[0]&&v.x()(at,ar)<=h[1]})}}));if(Q.length){y=u.xScale()}else{y=v.xScale()}p.scale(y).ticks(P/100).tickSize(-V,0);p.domain([Math.ceil(h[0]),Math.floor(h[1])]);ah.select(".nv-x.nv-axis").transition().duration(I).call(p);ao.transition().duration(I).call(u);an.transition().duration(I).call(v);ah.select(".nv-focus .nv-x.nv-axis").attr("transform","translate(0,"+O.range()[0]+")");m.scale(O).ticks(V/36).tickSize(-P,0);ah.select(".nv-focus .nv-y1.nv-axis").style("opacity",Q.length?1:0);g.scale(M).ticks(V/36).tickSize(Q.length?0:-P,0);ah.select(".nv-focus .nv-y2.nv-axis").style("opacity",ag.length?1:0).attr("transform","translate("+y.range()[1]+",0)");ah.select(".nv-focus .nv-y1.nv-axis").transition().duration(I).call(m);ah.select(".nv-focus .nv-y2.nv-axis").transition().duration(I).call(g)}ac()});return J}v.dispatch.on("elementMouseover.tooltip",function(x){x.pos=[x.pos[0]+i.left,x.pos[1]+i.top];B.tooltipShow(x)});v.dispatch.on("elementMouseout.tooltip",function(x){B.tooltipHide(x)});u.dispatch.on("elementMouseover.tooltip",function(x){x.pos=[x.pos[0]+i.left,x.pos[1]+i.top];B.tooltipShow(x)});u.dispatch.on("elementMouseout.tooltip",function(x){B.tooltipHide(x)});B.on("tooltipHide",function(){if(C){c.tooltip.cleanup()}});J.dispatch=B;J.legend=z;J.lines=v;J.lines2=o;J.bars=u;J.bars2=A;J.xAxis=p;J.x2Axis=t;J.y1Axis=m;J.y2Axis=g;J.y3Axis=E;J.y4Axis=r;d3.rebind(J,v,"defined","size","clipVoronoi","interpolate");J.options=c.utils.optionsFunc.bind(J);J.x=function(x){if(!arguments.length){return F}F=x;v.x(x);u.x(x);return J};J.y=function(x){if(!arguments.length){return D}D=x;v.y(x);u.y(x);return J};J.margin=function(x){if(!arguments.length){return i}i.top=typeof x.top!="undefined"?x.top:i.top;i.right=typeof x.right!="undefined"?x.right:i.right;i.bottom=typeof x.bottom!="undefined"?x.bottom:i.bottom;i.left=typeof x.left!="undefined"?x.left:i.left;return J};J.width=function(x){if(!arguments.length){return e}e=x;return J};J.height=function(x){if(!arguments.length){return f}f=x;return J};J.color=function(x){if(!arguments.length){return s}s=c.utils.getColor(x);z.color(s);return J};J.showLegend=function(x){if(!arguments.length){return n}n=x;return J};J.tooltips=function(x){if(!arguments.length){return C}C=x;return J};J.tooltipContent=function(x){if(!arguments.length){return w}w=x;return J};J.noData=function(x){if(!arguments.length){return k}k=x;return J};J.brushExtent=function(x){if(!arguments.length){return j}j=x;return J};return J};c.models.multiBar=function(){var l={top:0,right:0,bottom:0,left:0},q=960,m=500,i=d3.scale.ordinal(),h=d3.scale.linear(),n=Math.floor(Math.random()*10000),w=function(x){return x.x},u=function(x){return x.y},f=[0],A=true,z=false,t=c.utils.defaultColor(),C=false,o=null,g,B=1200,s,p,k,r,E=0.1,D=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout");var v,e;function j(x){x.each(function(N){var Q=q-l.left-l.right,I=m-l.top-l.bottom,F=d3.select(this);if(C&&N.length){C=[{values:N[0].values.map(function(R){return{x:R.x,y:0,series:R.series,size:0.01}})}]}if(z){N=d3.layout.stack().offset("zero").values(function(R){return R.values}).y(u)(!N.length&&C?C:N)}N=N.map(function(S,R){S.values=S.values.map(function(T){T.series=R;return T});return S});if(z){N[0].values.map(function(T,R){var U=0,S=0;N.map(function(W){var V=W.values[R];V.size=Math.abs(V.y);if(V.y<0){V.y1=S;S=S-V.size}else{V.y1=V.size+U;U=U+V.size}})})}var H=(s&&p)?[]:N.map(function(R){return R.values.map(function(T,S){return{x:w(T,S),y:u(T,S),y0:T.y0,y1:T.y1}})});i.domain(s||d3.merge(H).map(function(R){return R.x})).rangeBands(k||[0,Q],E);h.domain(p||d3.extent(d3.merge(H).map(function(R){return z?(R.y>0?R.y1:R.y1+R.y):R.y}).concat(f))).range(r||[I,0]);if(i.domain()[0]===i.domain()[1]){i.domain()[0]?i.domain([i.domain()[0]-i.domain()[0]*0.01,i.domain()[1]+i.domain()[1]*0.01]):i.domain([-1,1])}if(h.domain()[0]===h.domain()[1]){h.domain()[0]?h.domain([h.domain()[0]+h.domain()[0]*0.01,h.domain()[1]-h.domain()[1]*0.01]):h.domain([-1,1])}v=v||i;e=e||h;var G=F.selectAll("g.nv-wrap.nv-multibar").data([N]);var L=G.enter().append("g").attr("class","nvd3 nv-wrap nv-multibar");var J=L.append("defs");var y=L.append("g");var O=G.select("g");y.append("g").attr("class","nv-groups");G.attr("transform","translate("+l.left+","+l.top+")");J.append("clipPath").attr("id","nv-edge-clip-"+n).append("rect");G.select("#nv-edge-clip-"+n+" rect").attr("width",Q).attr("height",I);O.attr("clip-path",A?"url(#nv-edge-clip-"+n+")":"");var K=G.select(".nv-groups").selectAll(".nv-group").data(function(R){return R},function(S,R){return R});K.enter().append("g").style("stroke-opacity",0.000001).style("fill-opacity",0.000001);K.exit().transition().selectAll("rect.nv-bar").delay(function(S,R){return R*B/N[0].values.length}).attr("y",function(R){return z?e(R.y0):e(0)}).attr("height",0).remove();K.attr("class",function(S,R){return"nv-group nv-series-"+R}).classed("hover",function(R){return R.hover}).style("fill",function(S,R){return t(S,R)}).style("stroke",function(S,R){return t(S,R)});K.transition().style("stroke-opacity",1).style("fill-opacity",0.75);var P=K.selectAll("rect.nv-bar").data(function(R){return(C&&!N.length)?C.values:R.values});P.exit().remove();var M=P.enter().append("rect").attr("class",function(S,R){return u(S,R)<0?"nv-bar negative":"nv-bar positive"}).attr("x",function(T,S,R){return z?0:(R*i.rangeBand()/N.length)}).attr("y",function(R){return e(z?R.y0:0)}).attr("height",0).attr("width",i.rangeBand()/(z?1:N.length)).attr("transform",function(S,R){return"translate("+i(w(S,R))+",0)"});P.style("fill",function(T,S,R){return t(T,R,S)}).style("stroke",function(T,S,R){return t(T,R,S)}).on("mouseover",function(S,R){d3.select(this).classed("hover",true);D.elementMouseover({value:u(S,R),point:S,series:N[S.series],pos:[i(w(S,R))+(i.rangeBand()*(z?N.length/2:S.series+0.5)/N.length),h(u(S,R)+(z?S.y0:0))],pointIndex:R,seriesIndex:S.series,e:d3.event})}).on("mouseout",function(S,R){d3.select(this).classed("hover",false);D.elementMouseout({value:u(S,R),point:S,series:N[S.series],pointIndex:R,seriesIndex:S.series,e:d3.event})}).on("click",function(S,R){D.elementClick({value:u(S,R),point:S,series:N[S.series],pos:[i(w(S,R))+(i.rangeBand()*(z?N.length/2:S.series+0.5)/N.length),h(u(S,R)+(z?S.y0:0))],pointIndex:R,seriesIndex:S.series,e:d3.event});d3.event.stopPropagation()}).on("dblclick",function(S,R){D.elementDblClick({value:u(S,R),point:S,series:N[S.series],pos:[i(w(S,R))+(i.rangeBand()*(z?N.length/2:S.series+0.5)/N.length),h(u(S,R)+(z?S.y0:0))],pointIndex:R,seriesIndex:S.series,e:d3.event});d3.event.stopPropagation()});P.attr("class",function(S,R){return u(S,R)<0?"nv-bar negative":"nv-bar positive"}).transition().attr("transform",function(S,R){return"translate("+i(w(S,R))+",0)"});if(o){if(!g){g=N.map(function(){return true})}P.style("fill",function(T,S,R){return d3.rgb(o(T,S)).darker(g.map(function(V,U){return U}).filter(function(V,U){return !g[U]})[R]).toString()}).style("stroke",function(T,S,R){return d3.rgb(o(T,S)).darker(g.map(function(V,U){return U}).filter(function(V,U){return !g[U]})[R]).toString()})}if(z){P.transition().delay(function(S,R){return R*B/N[0].values.length}).attr("y",function(S,R){return h((z?S.y1:0))}).attr("height",function(S,R){return Math.max(Math.abs(h(S.y+(z?S.y0:0))-h((z?S.y0:0))),1)}).attr("x",function(S,R){return z?0:(S.series*i.rangeBand()/N.length)}).attr("width",i.rangeBand()/(z?1:N.length))}else{P.transition().delay(function(S,R){return R*B/N[0].values.length}).attr("x",function(S,R){return S.series*i.rangeBand()/N.length}).attr("width",i.rangeBand()/N.length).attr("y",function(S,R){return u(S,R)<0?h(0):h(0)-h(u(S,R))<1?h(0)-1:h(u(S,R))||0}).attr("height",function(S,R){return Math.max(Math.abs(h(u(S,R))-h(0)),1)||0})}v=i.copy();e=h.copy()});return j}j.dispatch=D;j.options=c.utils.optionsFunc.bind(j);j.x=function(x){if(!arguments.length){return w}w=x;return j};j.y=function(x){if(!arguments.length){return u}u=x;return j};j.margin=function(x){if(!arguments.length){return l}l.top=typeof x.top!="undefined"?x.top:l.top;l.right=typeof x.right!="undefined"?x.right:l.right;l.bottom=typeof x.bottom!="undefined"?x.bottom:l.bottom;l.left=typeof x.left!="undefined"?x.left:l.left;return j};j.width=function(x){if(!arguments.length){return q}q=x;return j};j.height=function(x){if(!arguments.length){return m}m=x;return j};j.xScale=function(x){if(!arguments.length){return i}i=x;return j};j.yScale=function(x){if(!arguments.length){return h}h=x;return j};j.xDomain=function(x){if(!arguments.length){return s}s=x;return j};j.yDomain=function(x){if(!arguments.length){return p}p=x;return j};j.xRange=function(x){if(!arguments.length){return k}k=x;return j};j.yRange=function(x){if(!arguments.length){return r}r=x;return j};j.forceY=function(x){if(!arguments.length){return f}f=x;return j};j.stacked=function(x){if(!arguments.length){return z}z=x;return j};j.clipEdge=function(x){if(!arguments.length){return A}A=x;return j};j.color=function(x){if(!arguments.length){return t}t=c.utils.getColor(x);return j};j.barColor=function(x){if(!arguments.length){return o}o=c.utils.getColor(x);return j};j.disabled=function(x){if(!arguments.length){return g}g=x;return j};j.id=function(x){if(!arguments.length){return n}n=x;return j};j.hideable=function(x){if(!arguments.length){return C}C=x;return j};j.delay=function(x){if(!arguments.length){return B}B=x;return j};j.groupSpacing=function(x){if(!arguments.length){return E}E=x;return j};return j};c.models.multiBarChart=function(){var j=c.models.multiBar(),r=c.models.axis(),f=c.models.axis(),i=c.models.legend(),z=c.models.legend();var B={top:30,right:20,bottom:50,left:60},D=null,C=null,E=c.utils.defaultColor(),H=true,F=true,G=true,u=true,q=false,w=true,h=false,k=0,g=true,o=function(K,J,N,M,L){return"

"+K+"

"+N+" on "+J+"

"},t,s,n={stacked:false},p=null,m="No Data Available.",I=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),e=function(){return H?180:0},v=250;j.stacked(false);r.orient("bottom").tickPadding(7).highlightZero(true).showMaxMin(false).tickFormat(function(x){return x});f.orient((q)?"right":"left").tickFormat(d3.format(",.1f"));z.updateState(false);var l=function(O,K){var N=O.pos[0]+(K.offsetLeft||0),M=O.pos[1]+(K.offsetTop||0),J=r.tickFormat()(j.x()(O.point,O.pointIndex)),P=f.tickFormat()(j.y()(O.point,O.pointIndex)),L=o(O.series.key,J,P,O,A);c.tooltip.show([N,M],L,O.value<0?"n":"s",null,K)};function A(x){x.each(function(R){var K=d3.select(this),U=this;var Y=(D||parseInt(K.style("width"))||960)-B.left-B.right,N=(C||parseInt(K.style("height"))||400)-B.top-B.bottom;A.update=function(){K.transition().duration(v).call(A)};A.container=this;n.disabled=R.map(function(Z){return !!Z.disabled});if(!p){var X;p={};for(X in n){if(n[X] instanceof Array){p[X]=n[X].slice(0)}else{p[X]=n[X]}}}if(!R||!R.length||!R.filter(function(Z){return Z.values.length}).length){var L=K.selectAll(".nv-noData").data([m]);L.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle");L.attr("x",B.left+Y/2).attr("y",B.top+N/2).text(function(Z){return Z});return A}else{K.selectAll(".nv-noData").remove()}t=j.xScale();s=j.yScale();var M=K.selectAll("g.nv-wrap.nv-multiBarWithLegend").data([R]);var y=M.enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarWithLegend").append("g");var S=M.select("g");y.append("g").attr("class","nv-x nv-axis");y.append("g").attr("class","nv-y nv-axis");y.append("g").attr("class","nv-barsWrap");y.append("g").attr("class","nv-legendWrap");y.append("g").attr("class","nv-controlsWrap");if(F){i.width(Y-e());if(j.barColor()){R.forEach(function(aa,Z){aa.color=d3.rgb("#ccc").darker(Z*1.5).toString()})}S.select(".nv-legendWrap").datum(R).call(i);if(B.top!=i.height()){B.top=i.height();N=(C||parseInt(K.style("height"))||400)-B.top-B.bottom}S.select(".nv-legendWrap").attr("transform","translate("+e()+","+(-B.top)+")")}if(H){var V=[{key:"Grouped",disabled:j.stacked()},{key:"Stacked",disabled:!j.stacked()}];z.width(e()).color(["#444","#444","#444"]);S.select(".nv-controlsWrap").datum(V).attr("transform","translate(0,"+(-B.top)+")").call(z)}M.attr("transform","translate("+B.left+","+B.top+")");if(q){S.select(".nv-y.nv-axis").attr("transform","translate("+Y+",0)")}j.disabled(R.map(function(Z){return Z.disabled})).width(Y).height(N).color(R.map(function(aa,Z){return aa.color||E(aa,Z)}).filter(function(aa,Z){return !R[Z].disabled}));var T=S.select(".nv-barsWrap").datum(R.filter(function(Z){return !Z.disabled}));T.transition().call(j);if(G){r.scale(t).ticks(Y/100).tickSize(-N,0);S.select(".nv-x.nv-axis").attr("transform","translate(0,"+s.range()[0]+")");S.select(".nv-x.nv-axis").transition().call(r);var Q=S.select(".nv-x.nv-axis > g").selectAll("g");Q.selectAll("line, text").style("opacity",1);if(h){var W=function(Z,aa){return"translate("+Z+","+aa+")"};var J=5,P=17;Q.selectAll("text").attr("transform",function(ab,aa,Z){return W(0,(Z%2==0?J:P))});var O=d3.selectAll(".nv-x.nv-axis .nv-wrap g g text")[0].length;S.selectAll(".nv-x.nv-axis .nv-axisMaxMin text").attr("transform",function(aa,Z){return W(0,(Z===0||O%2!==0)?P:J)})}if(w){Q.filter(function(aa,Z){return Z%Math.ceil(R[0].values.length/(Y/100))!==0}).selectAll("text, line").style("opacity",0)}if(k){Q.selectAll(".tick text").attr("transform","rotate("+k+" 0,0)").style("text-anchor",k>0?"start":"end")}S.select(".nv-x.nv-axis").selectAll("g.nv-axisMaxMin text").style("opacity",1)}if(u){f.scale(s).ticks(N/36).tickSize(-Y,0);S.select(".nv-y.nv-axis").transition().call(f)}i.dispatch.on("stateChange",function(Z){n=Z;I.stateChange(n);A.update()});z.dispatch.on("legendClick",function(aa,Z){if(!aa.disabled){return}V=V.map(function(ab){ab.disabled=true;return ab});aa.disabled=false;switch(aa.key){case"Grouped":j.stacked(false);break;case"Stacked":j.stacked(true);break}n.stacked=j.stacked();I.stateChange(n);A.update()});I.on("tooltipShow",function(Z){if(g){l(Z,U.parentNode)}});I.on("changeState",function(Z){if(typeof Z.disabled!=="undefined"){R.forEach(function(ab,aa){ab.disabled=Z.disabled[aa]});n.disabled=Z.disabled}if(typeof Z.stacked!=="undefined"){j.stacked(Z.stacked);n.stacked=Z.stacked}A.update()})});return A}j.dispatch.on("elementMouseover.tooltip",function(x){x.pos=[x.pos[0]+B.left,x.pos[1]+B.top];I.tooltipShow(x)});j.dispatch.on("elementMouseout.tooltip",function(x){I.tooltipHide(x)});I.on("tooltipHide",function(){if(g){c.tooltip.cleanup()}});A.dispatch=I;A.multibar=j;A.legend=i;A.xAxis=r;A.yAxis=f;d3.rebind(A,j,"x","y","xDomain","yDomain","xRange","yRange","forceX","forceY","clipEdge","id","stacked","delay","barColor","groupSpacing");A.options=c.utils.optionsFunc.bind(A);A.margin=function(x){if(!arguments.length){return B}B.top=typeof x.top!="undefined"?x.top:B.top;B.right=typeof x.right!="undefined"?x.right:B.right;B.bottom=typeof x.bottom!="undefined"?x.bottom:B.bottom;B.left=typeof x.left!="undefined"?x.left:B.left;return A};A.width=function(x){if(!arguments.length){return D}D=x;return A};A.height=function(x){if(!arguments.length){return C}C=x;return A};A.color=function(x){if(!arguments.length){return E}E=c.utils.getColor(x);i.color(E);return A};A.showControls=function(x){if(!arguments.length){return H}H=x;return A};A.showLegend=function(x){if(!arguments.length){return F}F=x;return A};A.showXAxis=function(x){if(!arguments.length){return G}G=x;return A};A.showYAxis=function(x){if(!arguments.length){return u}u=x;return A};A.rightAlignYAxis=function(x){if(!arguments.length){return q}q=x;f.orient((x)?"right":"left");return A};A.reduceXTicks=function(x){if(!arguments.length){return w}w=x;return A};A.rotateLabels=function(x){if(!arguments.length){return k}k=x;return A};A.staggerLabels=function(x){if(!arguments.length){return h}h=x;return A};A.tooltip=function(x){if(!arguments.length){return o}o=x;return A};A.tooltips=function(x){if(!arguments.length){return g}g=x;return A};A.tooltipContent=function(x){if(!arguments.length){return o}o=x;return A};A.state=function(x){if(!arguments.length){return n}n=x;return A};A.defaultState=function(x){if(!arguments.length){return p}p=x;return A};A.noData=function(x){if(!arguments.length){return m}m=x;return A};A.transitionDuration=function(x){if(!arguments.length){return v}v=x;return A};return A};c.models.multiBarHorizontal=function(){var n={top:0,right:0,bottom:0,left:0},s=960,o=500,p=Math.floor(Math.random()*10000),j=d3.scale.ordinal(),i=d3.scale.linear(),A=function(x){return x.x},w=function(x){return x.y},f=[0],v=c.utils.defaultColor(),q=null,g,C=false,B=false,k=60,h=d3.format(",.2f"),D=1200,u,r,m,t,E=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout");var z,e;function l(x){x.each(function(N){var Q=s-n.left-n.right,I=o-n.top-n.bottom,F=d3.select(this);if(C){N=d3.layout.stack().offset("zero").values(function(R){return R.values}).y(w)(N)}N=N.map(function(S,R){S.values=S.values.map(function(T){T.series=R;return T});return S});if(C){N[0].values.map(function(T,R){var U=0,S=0;N.map(function(W){var V=W.values[R];V.size=Math.abs(V.y);if(V.y<0){V.y1=S-V.size;S=S-V.size}else{V.y1=U;U=U+V.size}})})}var H=(u&&r)?[]:N.map(function(R){return R.values.map(function(T,S){return{x:A(T,S),y:w(T,S),y0:T.y0,y1:T.y1}})});j.domain(u||d3.merge(H).map(function(R){return R.x})).rangeBands(m||[0,I],0.1);i.domain(r||d3.extent(d3.merge(H).map(function(R){return C?(R.y>0?R.y1+R.y:R.y1):R.y}).concat(f)));if(B&&!C){i.range(t||[(i.domain()[0]<0?k:0),Q-(i.domain()[1]>0?k:0)])}else{i.range(t||[0,Q])}z=z||j;e=e||d3.scale.linear().domain(i.domain()).range([i(0),i(0)]);var G=d3.select(this).selectAll("g.nv-wrap.nv-multibarHorizontal").data([N]);var L=G.enter().append("g").attr("class","nvd3 nv-wrap nv-multibarHorizontal");var J=L.append("defs");var y=L.append("g");var O=G.select("g");y.append("g").attr("class","nv-groups");G.attr("transform","translate("+n.left+","+n.top+")");var K=G.select(".nv-groups").selectAll(".nv-group").data(function(R){return R},function(S,R){return R});K.enter().append("g").style("stroke-opacity",0.000001).style("fill-opacity",0.000001);K.exit().transition().style("stroke-opacity",0.000001).style("fill-opacity",0.000001).remove();K.attr("class",function(S,R){return"nv-group nv-series-"+R}).classed("hover",function(R){return R.hover}).style("fill",function(S,R){return v(S,R)}).style("stroke",function(S,R){return v(S,R)});K.transition().style("stroke-opacity",1).style("fill-opacity",0.75);var P=K.selectAll("g.nv-bar").data(function(R){return R.values});P.exit().remove();var M=P.enter().append("g").attr("transform",function(T,S,R){return"translate("+e(C?T.y0:0)+","+(C?0:(R*j.rangeBand()/N.length)+j(A(T,S)))+")"});M.append("rect").attr("width",0).attr("height",j.rangeBand()/(C?1:N.length));P.on("mouseover",function(S,R){d3.select(this).classed("hover",true);E.elementMouseover({value:w(S,R),point:S,series:N[S.series],pos:[i(w(S,R)+(C?S.y0:0)),j(A(S,R))+(j.rangeBand()*(C?N.length/2:S.series+0.5)/N.length)],pointIndex:R,seriesIndex:S.series,e:d3.event})}).on("mouseout",function(S,R){d3.select(this).classed("hover",false);E.elementMouseout({value:w(S,R),point:S,series:N[S.series],pointIndex:R,seriesIndex:S.series,e:d3.event})}).on("click",function(S,R){E.elementClick({value:w(S,R),point:S,series:N[S.series],pos:[j(A(S,R))+(j.rangeBand()*(C?N.length/2:S.series+0.5)/N.length),i(w(S,R)+(C?S.y0:0))],pointIndex:R,seriesIndex:S.series,e:d3.event});d3.event.stopPropagation()}).on("dblclick",function(S,R){E.elementDblClick({value:w(S,R),point:S,series:N[S.series],pos:[j(A(S,R))+(j.rangeBand()*(C?N.length/2:S.series+0.5)/N.length),i(w(S,R)+(C?S.y0:0))],pointIndex:R,seriesIndex:S.series,e:d3.event});d3.event.stopPropagation()});M.append("text");if(B&&!C){P.select("text").attr("text-anchor",function(S,R){return w(S,R)<0?"end":"start"}).attr("y",j.rangeBand()/(N.length*2)).attr("dy",".32em").text(function(S,R){return h(w(S,R))});P.transition().select("text").attr("x",function(S,R){return w(S,R)<0?-4:i(w(S,R))-i(0)+4})}else{P.selectAll("text").text("")}P.attr("class",function(S,R){return w(S,R)<0?"nv-bar negative":"nv-bar positive"});if(q){if(!g){g=N.map(function(){return true})}P.style("fill",function(T,S,R){return d3.rgb(q(T,S)).darker(g.map(function(V,U){return U}).filter(function(V,U){return !g[U]})[R]).toString()}).style("stroke",function(T,S,R){return d3.rgb(q(T,S)).darker(g.map(function(V,U){return U}).filter(function(V,U){return !g[U]})[R]).toString()})}if(C){P.transition().attr("transform",function(S,R){return"translate("+i(S.y1)+","+j(A(S,R))+")"}).select("rect").attr("width",function(S,R){return Math.abs(i(w(S,R)+S.y0)-i(S.y0))}).attr("height",j.rangeBand())}else{P.transition().attr("transform",function(S,R){return"translate("+(w(S,R)<0?i(w(S,R)):i(0))+","+(S.series*j.rangeBand()/N.length+j(A(S,R)))+")"}).select("rect").attr("height",j.rangeBand()/N.length).attr("width",function(S,R){return Math.max(Math.abs(i(w(S,R))-i(0)),1)})}z=j.copy();e=i.copy()});return l}l.dispatch=E;l.options=c.utils.optionsFunc.bind(l);l.x=function(x){if(!arguments.length){return A}A=x;return l};l.y=function(x){if(!arguments.length){return w}w=x;return l};l.margin=function(x){if(!arguments.length){return n}n.top=typeof x.top!="undefined"?x.top:n.top;n.right=typeof x.right!="undefined"?x.right:n.right;n.bottom=typeof x.bottom!="undefined"?x.bottom:n.bottom;n.left=typeof x.left!="undefined"?x.left:n.left;return l};l.width=function(x){if(!arguments.length){return s}s=x;return l};l.height=function(x){if(!arguments.length){return o}o=x;return l};l.xScale=function(x){if(!arguments.length){return j}j=x;return l};l.yScale=function(x){if(!arguments.length){return i}i=x;return l};l.xDomain=function(x){if(!arguments.length){return u}u=x;return l};l.yDomain=function(x){if(!arguments.length){return r}r=x;return l};l.xRange=function(x){if(!arguments.length){return m}m=x;return l};l.yRange=function(x){if(!arguments.length){return t}t=x;return l};l.forceY=function(x){if(!arguments.length){return f}f=x;return l};l.stacked=function(x){if(!arguments.length){return C}C=x;return l};l.color=function(x){if(!arguments.length){return v}v=c.utils.getColor(x);return l};l.barColor=function(x){if(!arguments.length){return q}q=c.utils.getColor(x);return l};l.disabled=function(x){if(!arguments.length){return g}g=x;return l};l.id=function(x){if(!arguments.length){return p}p=x;return l};l.delay=function(x){if(!arguments.length){return D}D=x;return l};l.showValues=function(x){if(!arguments.length){return B}B=x;return l};l.valueFormat=function(x){if(!arguments.length){return h}h=x;return l};l.valuePadding=function(x){if(!arguments.length){return k}k=x;return l};return l};c.models.multiBarHorizontalChart=function(){var i=c.models.multiBarHorizontal(),o=c.models.axis(),f=c.models.axis(),h=c.models.legend().height(30),s=c.models.legend().height(30);var u={top:30,right:20,bottom:50,left:60},w=null,v=null,z=c.utils.defaultColor(),C=true,A=true,B=false,g=true,l=function(F,E,I,H,G){return"

"+F+" - "+E+"

"+I+"

"},q,p,m={stacked:B},n=null,k="No Data Available.",D=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),e=function(){return C?180:0},r=250;i.stacked(B);o.orient("left").tickPadding(5).highlightZero(false).showMaxMin(false).tickFormat(function(x){return x});f.orient("bottom").tickFormat(d3.format(",.1f"));s.updateState(false);var j=function(J,F){var I=J.pos[0]+(F.offsetLeft||0),H=J.pos[1]+(F.offsetTop||0),E=o.tickFormat()(i.x()(J.point,J.pointIndex)),K=f.tickFormat()(i.y()(J.point,J.pointIndex)),G=l(J.series.key,E,K,J,t);c.tooltip.show([I,H],G,J.value<0?"e":"w",null,F)};function t(x){x.each(function(J){var E=d3.select(this),M=this;var P=(w||parseInt(E.style("width"))||960)-u.left-u.right,H=(v||parseInt(E.style("height"))||400)-u.top-u.bottom;t.update=function(){E.transition().duration(r).call(t)};t.container=this;m.disabled=J.map(function(Q){return !!Q.disabled});if(!n){var O;n={};for(O in m){if(m[O] instanceof Array){n[O]=m[O].slice(0)}else{n[O]=m[O]}}}if(!J||!J.length||!J.filter(function(Q){return Q.values.length}).length){var F=E.selectAll(".nv-noData").data([k]);F.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle");F.attr("x",u.left+P/2).attr("y",u.top+H/2).text(function(Q){return Q});return t}else{E.selectAll(".nv-noData").remove()}q=i.xScale();p=i.yScale();var G=E.selectAll("g.nv-wrap.nv-multiBarHorizontalChart").data([J]);var y=G.enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarHorizontalChart").append("g");var K=G.select("g");y.append("g").attr("class","nv-x nv-axis");y.append("g").attr("class","nv-y nv-axis");y.append("g").attr("class","nv-barsWrap");y.append("g").attr("class","nv-legendWrap");y.append("g").attr("class","nv-controlsWrap");if(A){h.width(P-e());if(i.barColor()){J.forEach(function(R,Q){R.color=d3.rgb("#ccc").darker(Q*1.5).toString()})}K.select(".nv-legendWrap").datum(J).call(h);if(u.top!=h.height()){u.top=h.height();H=(v||parseInt(E.style("height"))||400)-u.top-u.bottom}K.select(".nv-legendWrap").attr("transform","translate("+e()+","+(-u.top)+")")}if(C){var N=[{key:"Grouped",disabled:i.stacked()},{key:"Stacked",disabled:!i.stacked()}];s.width(e()).color(["#444","#444","#444"]);K.select(".nv-controlsWrap").datum(N).attr("transform","translate(0,"+(-u.top)+")").call(s)}G.attr("transform","translate("+u.left+","+u.top+")");i.disabled(J.map(function(Q){return Q.disabled})).width(P).height(H).color(J.map(function(R,Q){return R.color||z(R,Q)}).filter(function(R,Q){return !J[Q].disabled}));var L=K.select(".nv-barsWrap").datum(J.filter(function(Q){return !Q.disabled}));L.transition().call(i);o.scale(q).ticks(H/24).tickSize(-P,0);K.select(".nv-x.nv-axis").transition().call(o);var I=K.select(".nv-x.nv-axis").selectAll("g");I.selectAll("line, text").style("opacity",1);f.scale(p).ticks(P/100).tickSize(-H,0);K.select(".nv-y.nv-axis").attr("transform","translate(0,"+H+")");K.select(".nv-y.nv-axis").transition().call(f);h.dispatch.on("stateChange",function(Q){m=Q;D.stateChange(m);t.update()});s.dispatch.on("legendClick",function(R,Q){if(!R.disabled){return}N=N.map(function(S){S.disabled=true;return S});R.disabled=false;switch(R.key){case"Grouped":i.stacked(false);break;case"Stacked":i.stacked(true);break}m.stacked=i.stacked();D.stateChange(m);t.update()});D.on("tooltipShow",function(Q){if(g){j(Q,M.parentNode)}});D.on("changeState",function(Q){if(typeof Q.disabled!=="undefined"){J.forEach(function(S,R){S.disabled=Q.disabled[R]});m.disabled=Q.disabled}if(typeof Q.stacked!=="undefined"){i.stacked(Q.stacked);m.stacked=Q.stacked}x.call(t)})});return t}i.dispatch.on("elementMouseover.tooltip",function(x){x.pos=[x.pos[0]+u.left,x.pos[1]+u.top];D.tooltipShow(x)});i.dispatch.on("elementMouseout.tooltip",function(x){D.tooltipHide(x)});D.on("tooltipHide",function(){if(g){c.tooltip.cleanup()}});t.dispatch=D;t.multibar=i;t.legend=h;t.xAxis=o;t.yAxis=f;d3.rebind(t,i,"x","y","xDomain","yDomain","xRange","yRange","forceX","forceY","clipEdge","id","delay","showValues","valueFormat","stacked","barColor");t.options=c.utils.optionsFunc.bind(t);t.margin=function(x){if(!arguments.length){return u}u.top=typeof x.top!="undefined"?x.top:u.top;u.right=typeof x.right!="undefined"?x.right:u.right;u.bottom=typeof x.bottom!="undefined"?x.bottom:u.bottom;u.left=typeof x.left!="undefined"?x.left:u.left;return t};t.width=function(x){if(!arguments.length){return w}w=x;return t};t.height=function(x){if(!arguments.length){return v}v=x;return t};t.color=function(x){if(!arguments.length){return z}z=c.utils.getColor(x);h.color(z);return t};t.showControls=function(x){if(!arguments.length){return C}C=x;return t};t.showLegend=function(x){if(!arguments.length){return A}A=x;return t};t.tooltip=function(x){if(!arguments.length){return l}l=x;return t};t.tooltips=function(x){if(!arguments.length){return g}g=x;return t};t.tooltipContent=function(x){if(!arguments.length){return l}l=x;return t};t.state=function(x){if(!arguments.length){return m}m=x;return t};t.defaultState=function(x){if(!arguments.length){return n}n=x;return t};t.noData=function(x){if(!arguments.length){return k}k=x;return t};t.transitionDuration=function(x){if(!arguments.length){return r}r=x;return t};return t};c.models.multiChart=function(){var w={top:30,right:20,bottom:50,left:60},B=d3.scale.category20().range(),A=null,z=null,C=true,h=true,l=function(H,G,K,J,I){return"

"+H+"

"+K+" at "+G+"

"},u,t,p,o;var u=d3.scale.linear(),E=d3.scale.linear(),D=d3.scale.linear(),r=c.models.line().yScale(E),q=c.models.line().yScale(D),j=c.models.multiBar().stacked(false).yScale(E),g=c.models.multiBar().stacked(false).yScale(D),n=c.models.stackedArea().yScale(E),m=c.models.stackedArea().yScale(D),s=c.models.axis().scale(u).orient("bottom").tickPadding(5),f=c.models.axis().scale(E).orient("left"),e=c.models.axis().scale(D).orient("right"),i=c.models.legend().height(30),F=d3.dispatch("tooltipShow","tooltipHide");var k=function(L,H){var K=L.pos[0]+(H.offsetLeft||0),J=L.pos[1]+(H.offsetTop||0),G=s.tickFormat()(r.x()(L.point,L.pointIndex)),M=((L.series.yAxis==2)?e:f).tickFormat()(r.y()(L.point,L.pointIndex)),I=l(L.series.key,G,M,L,v);c.tooltip.show([K,J],I,undefined,undefined,H.offsetParent)};function v(x){x.each(function(ac){var R=d3.select(this),J=this;v.update=function(){R.transition().call(v)};v.container=this;var y=(A||parseInt(R.style("width"))||960)-w.left-w.right,H=(z||parseInt(R.style("height"))||400)-w.top-w.bottom;var U=ac.filter(function(ad){return !ad.disabled&&ad.type=="line"&&ad.yAxis==1});var T=ac.filter(function(ad){return !ad.disabled&&ad.type=="line"&&ad.yAxis==2});var Y=ac.filter(function(ad){return !ad.disabled&&ad.type=="bar"&&ad.yAxis==1});var X=ac.filter(function(ad){return !ad.disabled&&ad.type=="bar"&&ad.yAxis==2});var Q=ac.filter(function(ad){return !ad.disabled&&ad.type=="area"&&ad.yAxis==1});var O=ac.filter(function(ad){return !ad.disabled&&ad.type=="area"&&ad.yAxis==2});var L=ac.filter(function(ad){return !ad.disabled&&ad.yAxis==1}).map(function(ad){return ad.values.map(function(af,ae){return{x:af.x,y:af.y}})});var K=ac.filter(function(ad){return !ad.disabled&&ad.yAxis==2}).map(function(ad){return ad.values.map(function(af,ae){return{x:af.x,y:af.y}})});u.domain(d3.extent(d3.merge(L.concat(K)),function(ad){return ad.x})).range([0,y]);var M=R.selectAll("g.wrap.multiChart").data([ac]);var V=M.enter().append("g").attr("class","wrap nvd3 multiChart").append("g");V.append("g").attr("class","x axis");V.append("g").attr("class","y1 axis");V.append("g").attr("class","y2 axis");V.append("g").attr("class","lines1Wrap");V.append("g").attr("class","lines2Wrap");V.append("g").attr("class","bars1Wrap");V.append("g").attr("class","bars2Wrap");V.append("g").attr("class","stack1Wrap");V.append("g").attr("class","stack2Wrap");V.append("g").attr("class","legendWrap");var Z=M.select("g");if(C){i.width(y/2);Z.select(".legendWrap").datum(ac.map(function(ad){ad.originalKey=ad.originalKey===undefined?ad.key:ad.originalKey;ad.key=ad.originalKey+(ad.yAxis==1?"":" (right axis)");return ad})).call(i);if(w.top!=i.height()){w.top=i.height();H=(z||parseInt(R.style("height"))||400)-w.top-w.bottom}Z.select(".legendWrap").attr("transform","translate("+(y/2)+","+(-w.top)+")")}r.width(y).height(H).interpolate("monotone").color(ac.map(function(ae,ad){return ae.color||B[ad%B.length]}).filter(function(ae,ad){return !ac[ad].disabled&&ac[ad].yAxis==1&&ac[ad].type=="line"}));q.width(y).height(H).interpolate("monotone").color(ac.map(function(ae,ad){return ae.color||B[ad%B.length]}).filter(function(ae,ad){return !ac[ad].disabled&&ac[ad].yAxis==2&&ac[ad].type=="line"}));j.width(y).height(H).color(ac.map(function(ae,ad){return ae.color||B[ad%B.length]}).filter(function(ae,ad){return !ac[ad].disabled&&ac[ad].yAxis==1&&ac[ad].type=="bar"}));g.width(y).height(H).color(ac.map(function(ae,ad){return ae.color||B[ad%B.length]}).filter(function(ae,ad){return !ac[ad].disabled&&ac[ad].yAxis==2&&ac[ad].type=="bar"}));n.width(y).height(H).color(ac.map(function(ae,ad){return ae.color||B[ad%B.length]}).filter(function(ae,ad){return !ac[ad].disabled&&ac[ad].yAxis==1&&ac[ad].type=="area"}));m.width(y).height(H).color(ac.map(function(ae,ad){return ae.color||B[ad%B.length]}).filter(function(ae,ad){return !ac[ad].disabled&&ac[ad].yAxis==2&&ac[ad].type=="area"}));Z.attr("transform","translate("+w.left+","+w.top+")");var G=Z.select(".lines1Wrap").datum(U);var I=Z.select(".bars1Wrap").datum(Y);var ab=Z.select(".stack1Wrap").datum(Q);var W=Z.select(".lines2Wrap").datum(T);var aa=Z.select(".bars2Wrap").datum(X);var S=Z.select(".stack2Wrap").datum(O);var P=Q.length?Q.map(function(ad){return ad.values}).reduce(function(ae,ad){return ae.map(function(af,ag){return{x:af.x,y:af.y+ad[ag].y}})}).concat([{x:0,y:0}]):[];var N=O.length?O.map(function(ad){return ad.values}).reduce(function(ae,ad){return ae.map(function(af,ag){return{x:af.x,y:af.y+ad[ag].y}})}).concat([{x:0,y:0}]):[];E.domain(p||d3.extent(d3.merge(L).concat(P),function(ad){return ad.y})).range([0,H]);D.domain(o||d3.extent(d3.merge(K).concat(N),function(ad){return ad.y})).range([0,H]);r.yDomain(E.domain());j.yDomain(E.domain());n.yDomain(E.domain());q.yDomain(D.domain());g.yDomain(D.domain());m.yDomain(D.domain());if(Q.length){d3.transition(ab).call(n)}if(O.length){d3.transition(S).call(m)}if(Y.length){d3.transition(I).call(j)}if(X.length){d3.transition(aa).call(g)}if(U.length){d3.transition(G).call(r)}if(T.length){d3.transition(W).call(q)}s.ticks(y/100).tickSize(-H,0);Z.select(".x.axis").attr("transform","translate(0,"+H+")");d3.transition(Z.select(".x.axis")).call(s);f.ticks(H/36).tickSize(-y,0);d3.transition(Z.select(".y1.axis")).call(f);e.ticks(H/36).tickSize(-y,0);d3.transition(Z.select(".y2.axis")).call(e);Z.select(".y2.axis").style("opacity",K.length?1:0).attr("transform","translate("+u.range()[1]+",0)");i.dispatch.on("stateChange",function(ad){v.update()});F.on("tooltipShow",function(ad){if(h){k(ad,J.parentNode)}})});return v}r.dispatch.on("elementMouseover.tooltip",function(x){x.pos=[x.pos[0]+w.left,x.pos[1]+w.top];F.tooltipShow(x)});r.dispatch.on("elementMouseout.tooltip",function(x){F.tooltipHide(x)});q.dispatch.on("elementMouseover.tooltip",function(x){x.pos=[x.pos[0]+w.left,x.pos[1]+w.top];F.tooltipShow(x)});q.dispatch.on("elementMouseout.tooltip",function(x){F.tooltipHide(x)});j.dispatch.on("elementMouseover.tooltip",function(x){x.pos=[x.pos[0]+w.left,x.pos[1]+w.top];F.tooltipShow(x)});j.dispatch.on("elementMouseout.tooltip",function(x){F.tooltipHide(x)});g.dispatch.on("elementMouseover.tooltip",function(x){x.pos=[x.pos[0]+w.left,x.pos[1]+w.top];F.tooltipShow(x)});g.dispatch.on("elementMouseout.tooltip",function(x){F.tooltipHide(x)});n.dispatch.on("tooltipShow",function(x){if(!Math.round(n.y()(x.point)*100)){setTimeout(function(){d3.selectAll(".point.hover").classed("hover",false)},0);return false}x.pos=[x.pos[0]+w.left,x.pos[1]+w.top],F.tooltipShow(x)});n.dispatch.on("tooltipHide",function(x){F.tooltipHide(x)});m.dispatch.on("tooltipShow",function(x){if(!Math.round(m.y()(x.point)*100)){setTimeout(function(){d3.selectAll(".point.hover").classed("hover",false)},0);return false}x.pos=[x.pos[0]+w.left,x.pos[1]+w.top],F.tooltipShow(x)});m.dispatch.on("tooltipHide",function(x){F.tooltipHide(x)});r.dispatch.on("elementMouseover.tooltip",function(x){x.pos=[x.pos[0]+w.left,x.pos[1]+w.top];F.tooltipShow(x)});r.dispatch.on("elementMouseout.tooltip",function(x){F.tooltipHide(x)});q.dispatch.on("elementMouseover.tooltip",function(x){x.pos=[x.pos[0]+w.left,x.pos[1]+w.top];F.tooltipShow(x)});q.dispatch.on("elementMouseout.tooltip",function(x){F.tooltipHide(x)});F.on("tooltipHide",function(){if(h){c.tooltip.cleanup()}});v.dispatch=F;v.lines1=r;v.lines2=q;v.bars1=j;v.bars2=g;v.stack1=n;v.stack2=m;v.xAxis=s;v.yAxis1=f;v.yAxis2=e;v.options=c.utils.optionsFunc.bind(v);v.x=function(x){if(!arguments.length){return getX}getX=x;r.x(x);j.x(x);return v};v.y=function(x){if(!arguments.length){return getY}getY=x;r.y(x);j.y(x);return v};v.yDomain1=function(x){if(!arguments.length){return p}p=x;return v};v.yDomain2=function(x){if(!arguments.length){return o}o=x;return v};v.margin=function(x){if(!arguments.length){return w}w=x;return v};v.width=function(x){if(!arguments.length){return A}A=x;return v};v.height=function(x){if(!arguments.length){return z}z=x;return v};v.color=function(x){if(!arguments.length){return B}B=x;i.color(x);return v};v.showLegend=function(x){if(!arguments.length){return C}C=x;return v};v.tooltips=function(x){if(!arguments.length){return h}h=x;return v};v.tooltipContent=function(x){if(!arguments.length){return l}l=x;return v};return v};c.models.ohlcBar=function(){var o={top:0,right:0,bottom:0,left:0},s=960,p=500,q=Math.floor(Math.random()*10000),j=d3.scale.linear(),i=d3.scale.linear(),z=function(x){return x.x},w=function(x){return x.y},f=function(x){return x.open},e=function(x){return x.close},B=function(x){return x.high},k=function(x){return x.low},h=[],g=[],l=false,A=true,v=c.utils.defaultColor(),u,r,n,t,C=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout");function m(x){x.each(function(J){var M=s-o.left-o.right,G=p-o.top-o.bottom,D=d3.select(this);j.domain(u||d3.extent(J[0].values.map(z).concat(h)));if(l){j.range(n||[M*0.5/J[0].values.length,M*(J[0].values.length-0.5)/J[0].values.length])}else{j.range(n||[0,M])}i.domain(r||[d3.min(J[0].values.map(k).concat(g)),d3.max(J[0].values.map(B).concat(g))]).range(t||[G,0]);if(j.domain()[0]===j.domain()[1]||i.domain()[0]===i.domain()[1]){singlePoint=true}if(j.domain()[0]===j.domain()[1]){j.domain()[0]?j.domain([j.domain()[0]-j.domain()[0]*0.01,j.domain()[1]+j.domain()[1]*0.01]):j.domain([-1,1])}if(i.domain()[0]===i.domain()[1]){i.domain()[0]?i.domain([i.domain()[0]+i.domain()[0]*0.01,i.domain()[1]-i.domain()[1]*0.01]):i.domain([-1,1])}var E=d3.select(this).selectAll("g.nv-wrap.nv-ohlcBar").data([J[0].values]);var I=E.enter().append("g").attr("class","nvd3 nv-wrap nv-ohlcBar");var H=I.append("defs");var y=I.append("g");var K=E.select("g");y.append("g").attr("class","nv-ticks");E.attr("transform","translate("+o.left+","+o.top+")");D.on("click",function(O,N){C.chartClick({data:O,index:N,pos:d3.event,id:q})});H.append("clipPath").attr("id","nv-chart-clip-path-"+q).append("rect");E.select("#nv-chart-clip-path-"+q+" rect").attr("width",M).attr("height",G);K.attr("clip-path",A?"url(#nv-chart-clip-path-"+q+")":"");var L=E.select(".nv-ticks").selectAll(".nv-tick").data(function(N){return N});L.exit().remove();var F=L.enter().append("path").attr("class",function(P,O,N){return(f(P,O)>e(P,O)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+N+"-"+O}).attr("d",function(P,O){var N=(M/J[0].values.length)*0.9;return"m0,0l0,"+(i(f(P,O))-i(B(P,O)))+"l"+(-N/2)+",0l"+(N/2)+",0l0,"+(i(k(P,O))-i(f(P,O)))+"l0,"+(i(e(P,O))-i(k(P,O)))+"l"+(N/2)+",0l"+(-N/2)+",0z"}).attr("transform",function(O,N){return"translate("+j(z(O,N))+","+i(B(O,N))+")"}).on("mouseover",function(O,N){d3.select(this).classed("hover",true);C.elementMouseover({point:O,series:J[0],pos:[j(z(O,N)),i(w(O,N))],pointIndex:N,seriesIndex:0,e:d3.event})}).on("mouseout",function(O,N){d3.select(this).classed("hover",false);C.elementMouseout({point:O,series:J[0],pointIndex:N,seriesIndex:0,e:d3.event})}).on("click",function(O,N){C.elementClick({value:w(O,N),data:O,index:N,pos:[j(z(O,N)),i(w(O,N))],e:d3.event,id:q});d3.event.stopPropagation()}).on("dblclick",function(O,N){C.elementDblClick({value:w(O,N),data:O,index:N,pos:[j(z(O,N)),i(w(O,N))],e:d3.event,id:q});d3.event.stopPropagation()});L.attr("class",function(P,O,N){return(f(P,O)>e(P,O)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+N+"-"+O});d3.transition(L).attr("transform",function(O,N){return"translate("+j(z(O,N))+","+i(B(O,N))+")"}).attr("d",function(P,O){var N=(M/J[0].values.length)*0.9;return"m0,0l0,"+(i(f(P,O))-i(B(P,O)))+"l"+(-N/2)+",0l"+(N/2)+",0l0,"+(i(k(P,O))-i(f(P,O)))+"l0,"+(i(e(P,O))-i(k(P,O)))+"l"+(N/2)+",0l"+(-N/2)+",0z"})});return m}m.dispatch=C;m.options=c.utils.optionsFunc.bind(m);m.x=function(x){if(!arguments.length){return z}z=x;return m};m.y=function(x){if(!arguments.length){return w}w=x;return m};m.open=function(x){if(!arguments.length){return f}f=x;return m};m.close=function(x){if(!arguments.length){return e}e=x;return m};m.high=function(x){if(!arguments.length){return B}B=x;return m};m.low=function(x){if(!arguments.length){return k}k=x;return m};m.margin=function(x){if(!arguments.length){return o}o.top=typeof x.top!="undefined"?x.top:o.top;o.right=typeof x.right!="undefined"?x.right:o.right;o.bottom=typeof x.bottom!="undefined"?x.bottom:o.bottom;o.left=typeof x.left!="undefined"?x.left:o.left;return m};m.width=function(x){if(!arguments.length){return s}s=x;return m};m.height=function(x){if(!arguments.length){return p}p=x;return m};m.xScale=function(x){if(!arguments.length){return j}j=x;return m};m.yScale=function(x){if(!arguments.length){return i}i=x;return m};m.xDomain=function(x){if(!arguments.length){return u}u=x;return m};m.yDomain=function(x){if(!arguments.length){return r}r=x;return m};m.xRange=function(x){if(!arguments.length){return n}n=x;return m};m.yRange=function(x){if(!arguments.length){return t}t=x;return m};m.forceX=function(x){if(!arguments.length){return h}h=x;return m};m.forceY=function(x){if(!arguments.length){return g}g=x;return m};m.padData=function(x){if(!arguments.length){return l}l=x;return m};m.clipEdge=function(x){if(!arguments.length){return A}A=x;return m};m.color=function(x){if(!arguments.length){return v}v=c.utils.getColor(x);return m};m.id=function(x){if(!arguments.length){return q}q=x;return m};return m};c.models.pie=function(){var l={top:0,right:0,bottom:0,left:0},q=500,m=500,w=function(z){return z.x},v=function(z){return z.y},h=function(z){return z.description},o=Math.floor(Math.random()*10000),s=c.utils.defaultColor(),f=d3.format(",.2f"),n=true,g=true,r=false,y="key",t=0.02,i=false,e=false,u=false,p=false,j=0.5,x=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout");function k(z){z.each(function(S){var A=q-l.left-l.right,D=m-l.top-l.bottom,E=Math.min(A,D)/2,H=E-(E/5),K=d3.select(this);var J=K.selectAll(".nv-wrap.nv-pie").data(S);var F=J.enter().append("g").attr("class","nvd3 nv-wrap nv-pie nv-chart-"+o);var O=F.append("g");var P=J.select("g");O.append("g").attr("class","nv-pie");J.attr("transform","translate("+l.left+","+l.top+")");P.select(".nv-pie").attr("transform","translate("+A/2+","+D/2+")");K.on("click",function(U,T){x.chartClick({data:U,index:T,pos:d3.event,id:o})});var I=d3.svg.arc().outerRadius(H);if(u){I.startAngle(u)}if(p){I.endAngle(p)}if(i){I.innerRadius(E*j)}var L=d3.layout.pie().sort(null).value(function(T){return T.disabled?0:v(T)});var B=J.select(".nv-pie").selectAll(".nv-slice").data(L);B.exit().remove();var R=B.enter().append("g").attr("class","nv-slice").on("mouseover",function(U,T){d3.select(this).classed("hover",true);x.elementMouseover({label:w(U.data),value:v(U.data),point:U.data,pointIndex:T,pos:[d3.event.pageX,d3.event.pageY],id:o})}).on("mouseout",function(U,T){d3.select(this).classed("hover",false);x.elementMouseout({label:w(U.data),value:v(U.data),point:U.data,index:T,id:o})}).on("click",function(U,T){x.elementClick({label:w(U.data),value:v(U.data),point:U.data,index:T,pos:d3.event,id:o});d3.event.stopPropagation()}).on("dblclick",function(U,T){x.elementDblClick({label:w(U.data),value:v(U.data),point:U.data,index:T,pos:d3.event,id:o});d3.event.stopPropagation()});B.attr("fill",function(U,T){return s(U,T)}).attr("stroke",function(U,T){return s(U,T)});var N=R.append("path").each(function(T){this._current=T});d3.transition(B.select("path")).attr("d",I).attrTween("d",C);if(n){var G=d3.svg.arc().innerRadius(0);if(g){G=I}if(r){G=d3.svg.arc().outerRadius(I.outerRadius())}R.append("g").classed("nv-label",true).each(function(V,T){var U=d3.select(this);U.attr("transform",function(X){if(e){X.outerRadius=H+10;X.innerRadius=H+15;var W=(X.startAngle+X.endAngle)/2*(180/Math.PI);if((X.startAngle+X.endAngle)/2t)?aa[y]:""});var U=V.select("text").node().getBBox();V.select(".nv-label rect").attr("width",U.width+10).attr("height",U.height+10).attr("transform",function(){return"translate("+[U.x-5,U.y-5]+")"})})}function Q(U){var T=(U.startAngle+U.endAngle)*90/Math.PI-90;return T>90?T-180:T}function C(T){T.endAngle=isNaN(T.endAngle)?0:T.endAngle;T.startAngle=isNaN(T.startAngle)?0:T.startAngle;if(!i){T.innerRadius=0}var U=d3.interpolate(this._current,T);this._current=U(0);return function(V){return I(U(V))}}function M(T){T.innerRadius=0;var U=d3.interpolate({startAngle:0,endAngle:0},T);return function(V){return I(U(V))}}});return k}k.dispatch=x;k.options=c.utils.optionsFunc.bind(k);k.margin=function(z){if(!arguments.length){return l}l.top=typeof z.top!="undefined"?z.top:l.top;l.right=typeof z.right!="undefined"?z.right:l.right;l.bottom=typeof z.bottom!="undefined"?z.bottom:l.bottom;l.left=typeof z.left!="undefined"?z.left:l.left;return k};k.width=function(z){if(!arguments.length){return q}q=z;return k};k.height=function(z){if(!arguments.length){return m}m=z;return k};k.values=function(z){c.log("pie.values() is no longer supported.");return k};k.x=function(z){if(!arguments.length){return w}w=z;return k};k.y=function(z){if(!arguments.length){return v}v=d3.functor(z);return k};k.description=function(z){if(!arguments.length){return h}h=z;return k};k.showLabels=function(z){if(!arguments.length){return n}n=z;return k};k.labelSunbeamLayout=function(z){if(!arguments.length){return e}e=z;return k};k.donutLabelsOutside=function(z){if(!arguments.length){return r}r=z;return k};k.pieLabelsOutside=function(z){if(!arguments.length){return g}g=z;return k};k.labelType=function(z){if(!arguments.length){return y}y=z;y=y||"key";return k};k.donut=function(z){if(!arguments.length){return i}i=z;return k};k.donutRatio=function(z){if(!arguments.length){return j}j=z;return k};k.startAngle=function(z){if(!arguments.length){return u}u=z;return k};k.endAngle=function(z){if(!arguments.length){return p}p=z;return k};k.id=function(z){if(!arguments.length){return o}o=z;return k};k.color=function(z){if(!arguments.length){return s}s=c.utils.getColor(z);return k};k.valueFormat=function(z){if(!arguments.length){return f}f=z;return k};k.labelThreshold=function(z){if(!arguments.length){return t}t=z;return k};return k};c.models.pieChart=function(){var i=c.models.pie(),m=c.models.legend();var g={top:30,right:20,bottom:20,left:20},f=null,q=null,p=true,h=c.utils.defaultColor(),l=true,s=function(t,w,v,u){return"

"+t+"

"+w+"

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

"+S+"

"+R+"

"},O={},z=null,H=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),m="No Data Available.",L=250;K.xScale(F).yScale(E);v.orient("bottom").tickPadding(10);n.orient((M)?"right":"left").tickPadding(10);C.axis("x");B.axis("y");w.updateState(false);var r,f;var P=function(T,W){var R=T.pos[0]+(W.offsetLeft||0),V=T.pos[1]+(W.offsetTop||0),S=T.pos[0]+(W.offsetLeft||0),y=E.range()[0]+k.top+(W.offsetTop||0),Q=F.range()[0]+k.left+(W.offsetLeft||0),x=T.pos[1]+(W.offsetTop||0),X=v.tickFormat()(K.x()(T.point,T.pointIndex)),U=n.tickFormat()(K.y()(T.point,T.pointIndex));if(j!=null){c.tooltip.show([S,y],j(T.series.key,X,U,T,N),"n",1,W,"x-nvtooltip")}if(h!=null){c.tooltip.show([Q,x],h(T.series.key,X,U,T,N),"e",1,W,"y-nvtooltip")}if(D!=null){c.tooltip.show([R,V],D(T.series.key,X,U,T.point.tooltip,T,N),T.value<0?"n":"s",null,W)}};var s=[{key:"Magnify",disabled:true}];function N(x){x.each(function(Y){var R=d3.select(this),aa=this;var ad=(e||parseInt(R.style("width"))||960)-k.left-k.right,U=(g||parseInt(R.style("height"))||400)-k.top-k.bottom;N.update=function(){R.transition().duration(L).call(N)};N.container=this;O.disabled=Y.map(function(ae){return !!ae.disabled});if(!z){var ac;z={};for(ac in O){if(O[ac] instanceof Array){z[ac]=O[ac].slice(0)}else{z[ac]=O[ac]}}}if(!Y||!Y.length||!Y.filter(function(ae){return ae.values.length}).length){var S=R.selectAll(".nv-noData").data([m]);S.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle");S.attr("x",k.left+ad/2).attr("y",k.top+U/2).text(function(ae){return ae});return N}else{R.selectAll(".nv-noData").remove()}F=K.xScale();E=K.yScale();r=r||F;f=f||E;var T=R.selectAll("g.nv-wrap.nv-scatterChart").data([Y]);var W=T.enter().append("g").attr("class","nvd3 nv-wrap nv-scatterChart nv-chart-"+K.id());var y=W.append("g");var Z=T.select("g");y.append("rect").attr("class","nvd3 nv-background").style("pointer-events","none");y.append("g").attr("class","nv-x nv-axis");y.append("g").attr("class","nv-y nv-axis");y.append("g").attr("class","nv-scatterWrap");y.append("g").attr("class","nv-regressionLinesWrap");y.append("g").attr("class","nv-distWrap");y.append("g").attr("class","nv-legendWrap");y.append("g").attr("class","nv-controlsWrap");T.attr("transform","translate("+k.left+","+k.top+")");if(M){Z.select(".nv-y.nv-axis").attr("transform","translate("+ad+",0)")}if(t){G.width(ad/2);T.select(".nv-legendWrap").datum(Y).call(G);if(k.top!=G.height()){k.top=G.height();U=(g||parseInt(R.style("height"))||400)-k.top-k.bottom}T.select(".nv-legendWrap").attr("transform","translate("+(ad/2)+","+(-k.top)+")")}if(l){w.width(180).color(["#444"]);Z.select(".nv-controlsWrap").datum(s).attr("transform","translate(0,"+(-k.top)+")").call(w)}K.width(ad).height(U).color(Y.map(function(af,ae){return af.color||A(af,ae)}).filter(function(af,ae){return !Y[ae].disabled}));T.select(".nv-scatterWrap").datum(Y.filter(function(ae){return !ae.disabled})).call(K);T.select(".nv-regressionLinesWrap").attr("clip-path","url(#nv-edge-clip-"+K.id()+")");var X=T.select(".nv-regressionLinesWrap").selectAll(".nv-regLines").data(function(ae){return ae});X.enter().append("g").attr("class","nv-regLines");var V=X.selectAll(".nv-regLine").data(function(ae){return[ae]});var ab=V.enter().append("line").attr("class","nv-regLine").style("stroke-opacity",0);V.transition().attr("x1",F.range()[0]).attr("x2",F.range()[1]).attr("y1",function(af,ae){return E(F.domain()[0]*af.slope+af.intercept)}).attr("y2",function(af,ae){return E(F.domain()[1]*af.slope+af.intercept)}).style("stroke",function(ag,af,ae){return A(ag,ae)}).style("stroke-opacity",function(af,ae){return(af.disabled||typeof af.slope==="undefined"||typeof af.intercept==="undefined")?0:1});if(i){v.scale(F).ticks(v.ticks()?v.ticks():ad/100).tickSize(-U,0);Z.select(".nv-x.nv-axis").attr("transform","translate(0,"+E.range()[0]+")").call(v)}if(J){n.scale(E).ticks(n.ticks()?n.ticks():U/36).tickSize(-ad,0);Z.select(".nv-y.nv-axis").call(n)}if(q){C.getData(K.x()).scale(F).width(ad).color(Y.map(function(af,ae){return af.color||A(af,ae)}).filter(function(af,ae){return !Y[ae].disabled}));y.select(".nv-distWrap").append("g").attr("class","nv-distributionX");Z.select(".nv-distributionX").attr("transform","translate(0,"+E.range()[0]+")").datum(Y.filter(function(ae){return !ae.disabled})).call(C)}if(o){B.getData(K.y()).scale(E).width(U).color(Y.map(function(af,ae){return af.color||A(af,ae)}).filter(function(af,ae){return !Y[ae].disabled}));y.select(".nv-distWrap").append("g").attr("class","nv-distributionY");Z.select(".nv-distributionY").attr("transform","translate("+(M?ad:-B.size())+",0)").datum(Y.filter(function(ae){return !ae.disabled})).call(B)}if(d3.fisheye){Z.select(".nv-background").attr("width",ad).attr("height",U);Z.select(".nv-background").on("mousemove",Q);Z.select(".nv-background").on("click",function(){p=!p});K.dispatch.on("elementClick.freezeFisheye",function(){p=!p})}function Q(){if(p){Z.select(".nv-point-paths").style("pointer-events","all");return false}Z.select(".nv-point-paths").style("pointer-events","none");var ae=d3.mouse(this);F.distortion(u).focus(ae[0]);E.distortion(u).focus(ae[1]);Z.select(".nv-scatterWrap").datum(Y.filter(function(af){return !af.disabled})).call(K);if(i){Z.select(".nv-x.nv-axis").call(v)}if(J){Z.select(".nv-y.nv-axis").call(n)}Z.select(".nv-distributionX").datum(Y.filter(function(af){return !af.disabled})).call(C);Z.select(".nv-distributionY").datum(Y.filter(function(af){return !af.disabled})).call(B)}w.dispatch.on("legendClick",function(af,ae){af.disabled=!af.disabled;u=af.disabled?0:2.5;Z.select(".nv-background").style("pointer-events",af.disabled?"none":"all");Z.select(".nv-point-paths").style("pointer-events",af.disabled?"all":"none");if(af.disabled){F.distortion(u).focus(0);E.distortion(u).focus(0);Z.select(".nv-scatterWrap").call(K);Z.select(".nv-x.nv-axis").call(v);Z.select(".nv-y.nv-axis").call(n)}else{p=false}N.update()});G.dispatch.on("stateChange",function(ae){O=ae;H.stateChange(O);N.update()});K.dispatch.on("elementMouseover.tooltip",function(ae){d3.select(".nv-chart-"+K.id()+" .nv-series-"+ae.seriesIndex+" .nv-distx-"+ae.pointIndex).attr("y1",ae.pos[1]-U);d3.select(".nv-chart-"+K.id()+" .nv-series-"+ae.seriesIndex+" .nv-disty-"+ae.pointIndex).attr("x2",ae.pos[0]+C.size());ae.pos=[ae.pos[0]+k.left,ae.pos[1]+k.top];H.tooltipShow(ae)});H.on("tooltipShow",function(ae){if(I){P(ae,aa.parentNode)}});H.on("changeState",function(ae){if(typeof ae.disabled!=="undefined"){Y.forEach(function(ag,af){ag.disabled=ae.disabled[af]});O.disabled=ae.disabled}N.update()});r=F.copy();f=E.copy()});return N}K.dispatch.on("elementMouseout.tooltip",function(x){H.tooltipHide(x);d3.select(".nv-chart-"+K.id()+" .nv-series-"+x.seriesIndex+" .nv-distx-"+x.pointIndex).attr("y1",0);d3.select(".nv-chart-"+K.id()+" .nv-series-"+x.seriesIndex+" .nv-disty-"+x.pointIndex).attr("x2",B.size())});H.on("tooltipHide",function(){if(I){c.tooltip.cleanup()}});N.dispatch=H;N.scatter=K;N.legend=G;N.controls=w;N.xAxis=v;N.yAxis=n;N.distX=C;N.distY=B;d3.rebind(N,K,"id","interactive","pointActive","x","y","shape","size","xScale","yScale","zScale","xDomain","yDomain","xRange","yRange","sizeDomain","sizeRange","forceX","forceY","forceSize","clipVoronoi","clipRadius","useVoronoi");N.options=c.utils.optionsFunc.bind(N);N.margin=function(x){if(!arguments.length){return k}k.top=typeof x.top!="undefined"?x.top:k.top;k.right=typeof x.right!="undefined"?x.right:k.right;k.bottom=typeof x.bottom!="undefined"?x.bottom:k.bottom;k.left=typeof x.left!="undefined"?x.left:k.left;return N};N.width=function(x){if(!arguments.length){return e}e=x;return N};N.height=function(x){if(!arguments.length){return g}g=x;return N};N.color=function(x){if(!arguments.length){return A}A=c.utils.getColor(x);G.color(A);C.color(A);B.color(A);return N};N.showDistX=function(x){if(!arguments.length){return q}q=x;return N};N.showDistY=function(x){if(!arguments.length){return o}o=x;return N};N.showControls=function(x){if(!arguments.length){return l}l=x;return N};N.showLegend=function(x){if(!arguments.length){return t}t=x;return N};N.showXAxis=function(x){if(!arguments.length){return i}i=x;return N};N.showYAxis=function(x){if(!arguments.length){return J}J=x;return N};N.rightAlignYAxis=function(x){if(!arguments.length){return M}M=x;n.orient((x)?"right":"left");return N};N.fisheye=function(x){if(!arguments.length){return u}u=x;return N};N.tooltips=function(x){if(!arguments.length){return I}I=x;return N};N.tooltipContent=function(x){if(!arguments.length){return D}D=x;return N};N.tooltipXContent=function(x){if(!arguments.length){return j}j=x;return N};N.tooltipYContent=function(x){if(!arguments.length){return h}h=x;return N};N.state=function(x){if(!arguments.length){return O}O=x;return N};N.defaultState=function(x){if(!arguments.length){return z}z=x;return N};N.noData=function(x){if(!arguments.length){return m}m=x;return N};N.transitionDuration=function(x){if(!arguments.length){return L}L=x;return N};return N};c.models.sparkline=function(){var k={top:2,right:0,bottom:2,left:0},g=400,r=32,h=true,o=d3.scale.linear(),n=d3.scale.linear(),q=function(s){return s.x},p=function(s){return s.y},j=c.utils.getColor(["#000"]),l,f,e,i;function m(s){s.each(function(y){var B=g-k.left-k.right,w=r-k.top-k.bottom,u=d3.select(this);o.domain(l||d3.extent(y,q)).range(e||[0,B]);n.domain(f||d3.extent(y,p)).range(i||[w,0]);var v=u.selectAll("g.nv-wrap.nv-sparkline").data([y]);var x=v.enter().append("g").attr("class","nvd3 nv-wrap nv-sparkline");var t=x.append("g");var z=v.select("g");v.attr("transform","translate("+k.left+","+k.top+")");var C=v.selectAll("path").data(function(D){return[D]});C.enter().append("path");C.exit().remove();C.style("stroke",function(E,D){return E.color||j(E,D)}).attr("d",d3.svg.line().x(function(E,D){return o(q(E,D))}).y(function(E,D){return n(p(E,D))}));var A=v.selectAll("circle.nv-point").data(function(H){var F=H.map(function(K,J){return p(K,J)});function G(K){if(K!=-1){var J=H[K];J.pointIndex=K;return J}else{return null}}var E=G(F.lastIndexOf(n.domain()[1])),D=G(F.indexOf(n.domain()[0])),I=G(F.length-1);return[D,E,I].filter(function(J){return J!=null})});A.enter().append("circle");A.exit().remove();A.attr("cx",function(E,D){return o(q(E,E.pointIndex))}).attr("cy",function(E,D){return n(p(E,E.pointIndex))}).attr("r",2).attr("class",function(E,D){return q(E,E.pointIndex)==o.domain()[1]?"nv-point nv-currentValue":p(E,E.pointIndex)==n.domain()[0]?"nv-point nv-minValue":"nv-point nv-maxValue"})});return m}m.options=c.utils.optionsFunc.bind(m);m.margin=function(s){if(!arguments.length){return k}k.top=typeof s.top!="undefined"?s.top:k.top;k.right=typeof s.right!="undefined"?s.right:k.right;k.bottom=typeof s.bottom!="undefined"?s.bottom:k.bottom;k.left=typeof s.left!="undefined"?s.left:k.left;return m};m.width=function(s){if(!arguments.length){return g}g=s;return m};m.height=function(s){if(!arguments.length){return r}r=s;return m};m.x=function(s){if(!arguments.length){return q}q=d3.functor(s);return m};m.y=function(s){if(!arguments.length){return p}p=d3.functor(s);return m};m.xScale=function(s){if(!arguments.length){return o}o=s;return m};m.yScale=function(s){if(!arguments.length){return n}n=s;return m};m.xDomain=function(s){if(!arguments.length){return l}l=s;return m};m.yDomain=function(s){if(!arguments.length){return f}f=s;return m};m.xRange=function(s){if(!arguments.length){return e}e=s;return m};m.yRange=function(s){if(!arguments.length){return i}i=s;return m};m.animate=function(s){if(!arguments.length){return h}h=s;return m};m.color=function(s){if(!arguments.length){return j}j=c.utils.getColor(s);return m};return m};c.models.sparklinePlus=function(){var p=c.models.sparkline();var f={top:15,right:100,bottom:10,left:50},e=null,r=null,m,l,j=[],q=false,o=d3.format(",r"),i=d3.format(",.2f"),h=true,s=true,g=false,n="No Data Available.";function k(t){t.each(function(B){var v=d3.select(this);var I=(e||parseInt(v.style("width"))||960)-f.left-f.right,y=(r||parseInt(v.style("height"))||400)-f.top-f.bottom;k.update=function(){k(t)};k.container=this;if(!B||!B.length){var w=v.selectAll(".nv-noData").data([n]);w.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle");w.attr("x",f.left+I/2).attr("y",f.top+y/2).text(function(J){return J});return k}else{v.selectAll(".nv-noData").remove()}var H=p.y()(B[B.length-1],B.length-1);m=p.xScale();l=p.yScale();var x=v.selectAll("g.nv-wrap.nv-sparklineplus").data([B]);var z=x.enter().append("g").attr("class","nvd3 nv-wrap nv-sparklineplus");var u=z.append("g");var C=x.select("g");u.append("g").attr("class","nv-sparklineWrap");u.append("g").attr("class","nv-valueWrap");u.append("g").attr("class","nv-hoverArea");x.attr("transform","translate("+f.left+","+f.top+")");var D=C.select(".nv-sparklineWrap");p.width(I).height(y);D.call(p);var F=C.select(".nv-valueWrap");var G=F.selectAll(".nv-currentValue").data([H]);G.enter().append("text").attr("class","nv-currentValue").attr("dx",g?-8:8).attr("dy",".9em").style("text-anchor",g?"end":"start");G.attr("x",I+(g?f.right:0)).attr("y",s?function(J){return l(J)}:0).style("fill",p.color()(B[B.length-1],B.length-1)).text(i(H));u.select(".nv-hoverArea").append("rect").on("mousemove",A).on("click",function(){q=!q}).on("mouseout",function(){j=[];E()});C.select(".nv-hoverArea rect").attr("transform",function(J){return"translate("+-f.left+","+-f.top+")"}).attr("width",I+f.left+f.right).attr("height",y+f.top);function E(){if(q){return}var K=C.selectAll(".nv-hoverValue").data(j);var J=K.enter().append("g").attr("class","nv-hoverValue").style("stroke-opacity",0).style("fill-opacity",0);K.exit().transition().duration(250).style("stroke-opacity",0).style("fill-opacity",0).remove();K.attr("transform",function(L){return"translate("+m(p.x()(B[L],L))+",0)"}).transition().duration(250).style("stroke-opacity",1).style("fill-opacity",1);if(!j.length){return}J.append("line").attr("x1",0).attr("y1",-f.top).attr("x2",0).attr("y2",y);J.append("text").attr("class","nv-xValue").attr("x",-6).attr("y",-f.top).attr("text-anchor","end").attr("dy",".9em");C.select(".nv-hoverValue .nv-xValue").text(o(p.x()(B[j[0]],j[0])));J.append("text").attr("class","nv-yValue").attr("x",6).attr("y",-f.top).attr("text-anchor","start").attr("dy",".9em");C.select(".nv-hoverValue .nv-yValue").text(i(p.y()(B[j[0]],j[0])))}function A(){if(q){return}var K=d3.mouse(this)[0]-f.left;function J(O,L){var P=Math.abs(p.x()(O[0],0)-L);var N=0;for(var M=0;M"+L+"

"+O+" on "+K+"

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