orient=x;reverse=orient=="right"||orient=="bottom";returnchart};chart.ranges=function(x){if(!arguments.length)returnranges;ranges=x;returnchart};chart.markers=function(x){if(!arguments.length)returnmarkers;markers=x;returnchart};chart.measures=function(x){if(!arguments.length)returnmeasures;measures=x;returnchart};chart.width=function(x){if(!arguments.length)returnwidth;width=x;returnchart};chart.height=function(x){if(!arguments.length)returnheight;height=x;returnchart};chart.margin=function(_){if(!arguments.length)returnmargin;margin.top=typeof_.top!="undefined"?_.top:margin.top;margin.right=typeof_.right!="undefined"?_.right:margin.right;margin.bottom=typeof_.bottom!="undefined"?_.bottom:margin.bottom;margin.left=typeof_.left!="undefined"?_.left:margin.left;returnchart};chart.tickFormat=function(x){if(!arguments.length)returntickFormat;tickFormat=x;returnchart};chart.tooltips=function(_){if(!arguments.length)returntooltips;tooltips=_;returnchart};chart.tooltipContent=function(_){if(!arguments.length)returntooltip;tooltip=_;returnchart};chart.noData=function(_){if(!arguments.length)returnnoData;noData=_;returnchart};returnchart};nv.models.cumulativeLineChart=function(){varlines=nv.models.line(),xAxis=nv.models.axis(),yAxis=nv.models.axis(),legend=nv.models.legend(),controls=nv.models.legend(),interactiveLayer=nv.interactiveGuideline();varmargin={top:30,right:30,bottom:50,left:60},color=nv.utils.defaultColor(),width=null,height=null,showLegend=true,showXAxis=true,showYAxis=true,rightAlignYAxis=false,tooltips=true,showControls=true,useInteractiveGuideline=false,rescaleY=true,tooltip=function(key,x,y,e,graph){return"<h3>"+key+"</h3>"+"<p>"+y+" at "+x+"</p>"},x,y,id=lines.id(),state={index:0,rescaleY:rescaleY},defaultState=null,noData="No Data Available.",average=function(d){returnd.average},dispatch=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState");xAxis.orient("bottom").tickPadding(7);yAxis.orient(rightAlignYAxis?"right":"left");vardx=d3.scale.linear(),index={i:0,x:0};varshowTooltip=function(e,offsetElement){varleft=e.pos[0]+(offsetElement.offsetLeft||0),top=e.pos[1]+(offsetElement.offsetTop||0),x=xAxis.tickFormat()(lines.x()(e.point,e.pointIndex)),y=yAxis.tickFormat()(lines.y()(e.point,e.pointIndex)),content=tooltip(e.series.key,x,y,e,chart);nv.tooltip.show([left,top],content,null,null,offsetElement)};functionchart(selection){selection.each(function(data){varcontainer=d3.select(this).classed("nv-chart-"+id,true),that=this;varavailableWidth=(width||parseInt(container.style("width"))||960)-margin.left-margin.right,availableHeight=(height||parseInt(container.style("height"))||400)-margin.top-margin.bottom;chart.update=function(){container.transition().call(chart)};chart.container=this;state.disabled=data.map(function(d){return!!d.disabled});if(!defaultState){varkey;defaultState={};for(keyinstate){if(state[key]instanceofArray)defaultState[key]=state[key].slice(0);elsedefaultState[key]=state[key]}}varindexDrag=d3.behavior.drag().on("dragstart",dragStart).on("drag",dragMove).on("dragend",dragEnd);functiondragStart(d,i){d3.select(chart.container).style("cursor","ew-resize")}functiondragMove(d,i){index.x=d3.event.x;index.i=Math.round(dx.invert(index.x));updateZero()}functiondragEnd(d,i){d3.select(chart.container).style("cursor","auto");state.index=index.i;dispatch.stateChange(state)}if(!data||!data.length||!data.filter(function(d){returnd.values.length}).length){varnoDataText=container.selectAll(".nv-noData").data([noData]);noDataText.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle");noDataText.attr("x",margin.left+availableWidth/2).attr("y",margin.top+availableHeight/2).text(function(d){returnd});returnchart}else{container.selectAll(".nv-noData").remove()}x=lines.xScale();y=lines.yScale();if(!rescaleY){varseriesDomains=data.filter(function(series){return!series.disabled}).map(function(series,i){varinitialDomain=d3.extent(series.values,lines.y());if(initialDomain[0]<-.95)initialDomain[0]=-.95;return[(initial
margin.right=typeof_.right!="undefined"?_.right:margin.right;margin.bottom=typeof_.bottom!="undefined"?_.bottom:margin.bottom;margin.left=typeof_.left!="undefined"?_.left:margin.left;returnchart};chart.width=function(_){if(!arguments.length)returnwidth;width=_;returnchart};chart.height=function(_){if(!arguments.length)returnheight;height=_;returnchart};chart.xScale=function(_){if(!arguments.length)returnx;x=_;returnchart};chart.yScale=function(_){if(!arguments.length)returny;y=_;returnchart};chart.xDomain=function(_){if(!arguments.length)returnxDomain;xDomain=_;returnchart};chart.yDomain=function(_){if(!arguments.length)returnyDomain;yDomain=_;returnchart};chart.forceX=function(_){if(!arguments.length)returnforceX;forceX=_;returnchart};chart.forceY=function(_){if(!arguments.length)returnforceY;forceY=_;returnchart};chart.padData=function(_){if(!arguments.length)returnpadData;padData=_;returnchart};chart.clipEdge=function(_){if(!arguments.length)returnclipEdge;clipEdge=_;returnchart};chart.color=function(_){if(!arguments.length)returncolor;color=nv.utils.getColor(_);returnchart};chart.id=function(_){if(!arguments.length)returnid;id=_;returnchart};chart.interactive=function(_){if(!arguments.length)returninteractive;interactive=false;returnchart};returnchart};nv.models.historicalBarChart=function(){varbars=nv.models.historicalBar(),xAxis=nv.models.axis(),yAxis=nv.models.axis(),legend=nv.models.legend();varmargin={top:30,right:90,bottom:50,left:90},color=nv.utils.defaultColor(),width=null,height=null,showLegend=false,showXAxis=true,showYAxis=true,rightAlignYAxis=false,tooltips=true,tooltip=function(key,x,y,e,graph){return"<h3>"+key+"</h3>"+"<p>"+y+" at "+x+"</p>"},x,y,state={},defaultState=null,noData="No Data Available.",dispatch=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState");xAxis.orient("bottom").tickPadding(7);yAxis.orient(rightAlignYAxis?"right":"left");varshowTooltip=function(e,offsetElement){if(offsetElement){varsvg=d3.select(offsetElement).select("svg");varviewBox=svg.node()?svg.attr("viewBox"):null;if(viewBox){viewBox=viewBox.split(" ");varratio=parseInt(svg.style("width"))/viewBox[2];e.pos[0]=e.pos[0]*ratio;e.pos[1]=e.pos[1]*ratio}}varleft=e.pos[0]+(offsetElement.offsetLeft||0),top=e.pos[1]+(offsetElement.offsetTop||0),x=xAxis.tickFormat()(bars.x()(e.point,e.pointIndex)),y=yAxis.tickFormat()(bars.y()(e.point,e.pointIndex)),content=tooltip(e.series.key,x,y,e,chart);nv.tooltip.show([left,top],content,null,null,offsetElement)};functionchart(selection){selection.each(function(data){varcontainer=d3.select(this),that=this;varavailableWidth=(width||parseInt(container.style("width"))||960)-margin.left-margin.right,availableHeight=(height||parseInt(container.style("height"))||400)-margin.top-margin.bottom;chart.update=function(){chart(selection)};chart.container=this;state.disabled=data.map(function(d){return!!d.disabled});if(!defaultState){varkey;defaultState={};for(keyinstate){if(state[key]instanceofArray)defaultState[key]=state[key].slice(0);elsedefaultState[key]=state[key]}}if(!data||!data.length||!data.filter(function(d){returnd.values.length}).length){varnoDataText=container.selectAll(".nv-noData").data([noData]);noDataText.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle");noDataText.attr("x",margin.left+availableWidth/2).attr("y",margin.top+availableHeight/2).text(function(d){returnd});returnchart}else{container.selectAll(".nv-noData").remove()}x=bars.xScale();y=bars.yScale();varwrap=container.selectAll("g.nv-wrap.nv-historicalBarChart").data([data]);vargEnter=wrap.enter().append("g").attr("class","nvd3 nv-wrap nv-historicalBarChart").append("g");varg=wrap.select("g");gEnter.append("g").attr("class","nv-x nv-axis");gEnter.append("g").attr("class","nv-y nv-axis");gEnter.append("g").attr("class","nv-barsWrap");gEnter.append("g").attr("class","nv-legendWrap");if(showLegend){legend.width(availableWidth);g.select(".nv-legendWrap").datum(data).call(legend);if(margin.top!=legend.height()){margin.t
}).filter(function(d,i){return!disabled[i]})[j]).toString()}).style("stroke",function(d,i,j){returnd3.rgb(barColor(d,i)).darker(disabled.map(function(d,i){returni}).filter(function(d,i){return!disabled[i]})[j]).toString()})}if(stacked)bars.transition().delay(function(d,i){returni*delay/data[0].values.length}).attr("y",function(d,i){returny(stacked?d.y1:0)}).attr("height",function(d,i){returnMath.max(Math.abs(y(d.y+(stacked?d.y0:0))-y(stacked?d.y0:0)),1)}).each("end",function(){d3.select(this).transition().duration(drawTime).attr("x",function(d,i){returnstacked?0:d.series*x.rangeBand()/data.length}).attr("width",x.rangeBand()/(stacked?1:data.length))});elsed3.transition(bars).duration(drawTime).delay(function(d,i){returni*delay/data[0].values.length}).attr("x",function(d,i){returnd.series*x.rangeBand()/data.length}).attr("width",x.rangeBand()/data.length).each("end",function(){d3.select(this).transition().duration(drawTime).attr("y",function(d,i){returngetY(d,i)<0?y(0):y(0)-y(getY(d,i))<1?y(0)-1:y(getY(d,i))||0}).attr("height",function(d,i){returnMath.max(Math.abs(y(getY(d,i))-y(0)),1)||0})});x0=x.copy();y0=y.copy()});returnchart}chart.dispatch=dispatch;chart.x=function(_){if(!arguments.length)returngetX;getX=_;returnchart};chart.y=function(_){if(!arguments.length)returngetY;getY=_;returnchart};chart.margin=function(_){if(!arguments.length)returnmargin;margin.top=typeof_.top!="undefined"?_.top:margin.top;margin.right=typeof_.right!="undefined"?_.right:margin.right;margin.bottom=typeof_.bottom!="undefined"?_.bottom:margin.bottom;margin.left=typeof_.left!="undefined"?_.left:margin.left;returnchart};chart.width=function(_){if(!arguments.length)returnwidth;width=_;returnchart};chart.height=function(_){if(!arguments.length)returnheight;height=_;returnchart};chart.xScale=function(_){if(!arguments.length)returnx;x=_;returnchart};chart.yScale=function(_){if(!arguments.length)returny;y=_;returnchart};chart.xDomain=function(_){if(!arguments.length)returnxDomain;xDomain=_;returnchart};chart.yDomain=function(_){if(!arguments.length)returnyDomain;yDomain=_;returnchart};chart.forceY=function(_){if(!arguments.length)returnforceY;forceY=_;returnchart};chart.stacked=function(_){if(!arguments.length)returnstacked;stacked=_;returnchart};chart.clipEdge=function(_){if(!arguments.length)returnclipEdge;clipEdge=_;returnchart};chart.color=function(_){if(!arguments.length)returncolor;color=nv.utils.getColor(_);returnchart};chart.barColor=function(_){if(!arguments.length)returnbarColor;barColor=nv.utils.getColor(_);returnchart};chart.disabled=function(_){if(!arguments.length)returndisabled;disabled=_;returnchart};chart.id=function(_){if(!arguments.length)returnid;id=_;returnchart};chart.hideable=function(_){if(!arguments.length)returnhideable;hideable=_;returnchart};chart.delay=function(_){if(!arguments.length)returndelay;delay=_;returnchart};chart.drawTime=function(_){if(!arguments.length)returndrawTime;drawTime=_;returnchart};returnchart};nv.models.multiBarChart=function(){varmultibar=nv.models.multiBar(),xAxis=nv.models.axis(),yAxis=nv.models.axis(),legend=nv.models.legend(),controls=nv.models.legend();varmargin={top:30,right:20,bottom:50,left:60},width=null,height=null,color=nv.utils.defaultColor(),showControls=true,showLegend=true,showXAxis=true,showYAxis=true,rightAlignYAxis=false,reduceXTicks=true,staggerLabels=false,rotateLabels=0,tooltips=true,tooltip=function(key,x,y,e,graph){return"<h3>"+key+"</h3>"+"<p>"+y+" on "+x+"</p>"},x,y,state={stacked:false},defaultState=null,noData="No Data Available.",dispatch=d3.dispatch("tooltipShow","tooltipHide","stateChange","changeState"),controlWidth=function(){returnshowControls?180:0};multibar.stacked(false);xAxis.orient("bottom").tickPadding(7).highlightZero(true).showMaxMin(false).tickFormat(function(d){returnd});yAxis.orient(rightAlignYAxis?"right":"left").tickFormat(d3.format(",.1f"));varshowTooltip=function(e,offsetElement){varleft=e.pos[0]+(offsetElement.offsetLeft||0),top=e.pos[1]+(offsetElement.offsetTop||0),x=xAxis.tickFormat()(mul