text: var uv=function(){var t={};return t.util={},t.util.inherits=function(t){function e(){}return e.prototype=t.prototype||t,new e},t.util.getUniqueId=function(){return(new Date).getTime()},t.util.getMax=function(t,e){switch(e){case"stepup":return this.getStepMaxValue(t);case"normal":return this.getMaxValue(t);case"percent":return 100;case"waterfall":return this.getWaterfallMaxValue(t);default:console.error("Unknown classification for chart",e)}},t.util.getMaxValue=function(t){return d3.max(t.categories.map(function(e){return d3.max(t.dataset[e].map(function(t){return t.value}))}))},t.util.getStepMaxValue=function(t){var e=t.dataset[t.categories[0]].map(function(){return 0}),a=e.map(function(){return 0});return t.categories.map(function(n){t.dataset[n].map(function(t,n){e[n]+=t.value,a[n]=d3.max([e[n],a[n]])})}),d3.max(a)},t.util.getWaterfallMaxValue=function(t){var e=t.categories.map(function(){return 0});return t.categories.map(function(a,n){var r=0;t.dataset[a].map(function(t){r+=t.value,e[n]<r&&(e[n]=r)})}),d3.max(e)},t.util.getMin=function(t,e){switch(e){case"normal":return this.getMinValue(t);case"stepup":return this.getStepMinValue(t);default:return 0}},t.util.getMinValue=function(t){return d3.min([0,d3.min(t.categories.map(function(e){return d3.min(t.dataset[e].map(function(t){return t.value}))}))])},t.util.getStepMinValue=function(t){var e=t.dataset[t.categories[0]].map(function(){return 0}),a=e.map(function(){return 0});return t.categories.map(function(n){t.dataset[n].map(function(t,n){e[n]+=t.value,a[n]=d3.min([e[n],a[n]])})}),d3.min(a)},t.util.getSumUpArray=function(t){var e=t.dataset[t.categories[0]].map(function(){return 0});return t.categories.map(function(a){t.dataset[a].map(function(t,a){e[a]+=t.value})}),e},t.util.getPercentage=function(t,e){return 100*t/e},t.util.getDataArray=function(t){return t.categories.map(function(e){return t.dataset[e]})},t.util.getTabularArray=function(t){var e,a,n,r,o=[],s=[];for(e=0,r=t.dataset[t.categories[0]].length;r>e;e+=1){for(s=[],s.push(t.dataset[t.categories[0]][e].name),a=0,n=t.categories.length;n>a;a+=1)s.push(t.dataset[t.categories[a]][e].value);o.push(s)}return o},t.util.getLabelArray=function(t,e){return t.dataset[t.categories[e?e:0]].map(function(t){return t.name})},t.util.getCategoryArray=function(t){return t.categories.map(function(t){return t})},t.util.getCategoryData=function(t,e){return e.map(function(e){return t.dataset[e].map(function(t){return t.value})})},t.util.transposeData=function(t){var e,a,n,r,o,s,i,l={},c=t.dataset[t.categories[0]].map(function(t){return t.name});for(e=0,n=c.length;n>e;e+=1)l[c[e]]=[];for(e=0,n=t.categories.length;n>e;e+=1)for(o=t.categories[e],a=0,r=t.dataset[o].length;r>a;a+=1)s=t.dataset[o][a].name,i=t.dataset[o][a].value,l[s].push({name:o,value:i});t.categories=c,t.dataset=l},t.util.getPascalCasedName=function(t){return t.substring(0,1).toUpperCase()+t.substring(1)},t.util.getColorBand=function(e,a){{var n=0;e.graph.palette||"Default"}return e.graph.custompalette&&0!==e.graph.custompalette.length?(n=e.graph.custompalette.length,e.graph.custompalette[a%n]):(n=t.palette[e.graph.palette].length,t.palette[e.graph.palette][a%n])},t.util.formatClassName=function(t){var e=t.trim().replace(/[^A-Za-z0-9_\-]/g,"-").toLowerCase();return e},t.util.svgToPng=function(t,e){if(this.isCanvasSupported()){var a=d3.select(t.frame.node().parentNode).html(),n=document.createElement("canvas"),r=n.getContext("2d");n.setAttribute("width",d3.select(t.frame.node()).attr("width")),n.setAttribute("height",d3.select(t.frame.node()).attr("height")),r.drawSvg(a),n.toBlob(function(t){saveAs(t,"png_download"+Math.ceil(1e5*Math.random())+".png")},"image/png"),e.call()}else console.log("this feature is not supported in this version of browser")},t.util.isDownloadSupported=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return"function"==typeof e.drawSvg&&"function"==typeof t.toBlob},t.util.isCanvasSupported=function(){var t=document.createElement("canvas");return!(!t.getContext||!t.getContext("2d"))},t.util.endAll=function(t,e){var a=0;t.each(function(){++a}).each("end",function(){--a||e.apply(this,arguments)})},t.util.getClassName=function(e,a){var n=t.util.formatClassName(a);return d3.select(e).attr("class")?-1!==d3.select(e).attr("class").split(" ").indexOf(n)?d3.select(e).attr("class"):d3.select(e).attr("class")+" "+n:n},t.util.getLabelValue=function(t,e){if(void 0!==t.config.label.formatter)return t.config.label.formatter(e.value);var a=e.value%1===0?e.value:e.value.toFixed(t.config.label.precision);return t.config.label.prefix+String(a)+t.config.label.suffix},t.util._deepClone=function(e,a){if("object"==typeof a){var n=!0;for(var r in a)n=!1,a.hasOwnProperty(r)&&(void 0===e&&(e=Array.isArray(a)?[]:{}),e[r]=t.util._deepClone(e[r],a[r]));n&&(e=Array.isArray(a)?[]:{})}else e=a;return e},t.util.extend=function(){if(void 0===arguments[0]||null===arguments[0])return arguments[0];for(var e=1;e<arguments.length;e++)for(var a in arguments[e])arguments[e].hasOwnProperty(a)&&(arguments[0][a]=t.util._deepClone(arguments[0][a],arguments[e][a]));return arguments[0]},t.util.getTooltipText=function(e,a,n,r){if(!e.config.tooltip.show)return"";var o=e.config.tooltip.format;return""===o?a+" ["+n+"] : "+t.util.getLabelValue(r):o.replace(/%c/gi,a).replace(/%l/gi,n).replace(/%v/gi,t.util.getLabelValue(e,r))},t.config={graph:{palette:"Default",bgcolor:"#FFFFFF",orientation:"Horizontal",max:0,min:0,custompalette:[],opacity:1,responsive:!1,align:"xMinYMin",meetOrSlice:"meet"},meta:{position:"#uv-div",caption:"",subcaption:"",hlabel:"",vlabel:"",hsublabel:"",vsublabel:"",isDownloadable:!1,downloadLabel:"Download"},dimension:{width:400,height:400},margin:{top:50,bottom:150,left:100,right:100},frame:{bgcolor:"#FFFFFF"},axis:{ticks:8,subticks:2,padding:5,minor:-10,strokecolor:"#000000",fontfamily:"Arial",fontsize:"14",fontweight:"bold",showticks:!0,showsubticks:!0,showtext:!0,showhortext:!0,showvertext:!0,opacity:.1},label:{fontfamily:"Arial",fontsize:"11",fontweight:"normal",strokecolor:"#000000",showlabel:!0,precision:2,prefix:"",suffix:"",formatter:void 0},tooltip:{show:!0,format:"%c [%l]: %v"},scale:{type:"linear",ordinality:.2},bar:{strokecolor:"none",fontfamily:"Arial",fontsize:"10",fontweight:"bold",textcolor:"#000"},line:{interpolation:"linear",showcircles:!0,circleradius:3.5,circleopacity:.6,fontfamily:"Arial",fontsize:"10",fontweight:"bold",textcolor:"#000",strokewidth:1.5,strokeopacity:1},area:{interpolation:"cardinal",offset:"zero",opacity:.2},pie:{fontfamily:"Arial",fontsize:"14",fontweight:"normal",fontvariant:"small-caps",fontfill:"#FFFFFF",strokecolor:"#FFFFFF",strokewidth:1},donut:{fontfamily:"Arial",fontsize:"14",fontweight:"normal",fontvariant:"small-caps",fontfill:"#000",factor:.4,strokecolor:"#FFFFFF",strokewidth:1},caption:{fontfamily:"Arial",fontsize:"14",fontweight:"bold",fontvariant:"small-caps",textdecoration:"none",hovercolor:"#696969",strokecolor:"#0000FF",textanchor:"middle",cursor:"pointer"},subCaption:{fontfamily:"Arial",fontsize:"9",fontweight:"normal",fontvariant:"normal",textdecoration:"none",textanchor:"middle"},legend:{position:"bottom",fontfamily:"Arial",fontsize:"11",fontweight:"normal",color:"#000000",strokewidth:.15,textmargin:15,symbolsize:10,inactivecolor:"#DDD",legendstart:0,legendtype:"categories",showlegends:!0},effects:{hovercolor:"#FF0000",strokecolor:"none",textcolor:"#000000",duration:800,hover:400,showhovertext:!1}},t.constants={},t.constants.classes={uv:"uv",pos:"uv-div",frame:"uv-frame",panel:"uv-panel",bg:"uv-chart-bg",chart:"uv-chart",axes:"uv-axes",legend:"uv-legend",framebg:"uv-frame-bg",horaxis:"uv-hor-axis",veraxis:"uv-ver-axis",caption:"uv-caption",captiontext:"uv-caption-text",subcaption:"uv-subcaption",subcaptiontext:"uv-subcaption-text",axeslabelgroup:"uv-axes-label-group",axeslabel:"uv-axes-label",axessublabel:"uv-axes-sub-label",legendsign:"uv-legend-sign",legendlabel:"uv-legend-label",hoverbg:"uv-hover-bg",arc:"uv-arc-",areapath:"uv-areapath-",linepath:"uv-linepath-",area:"uv-area-",line:"uv-line-",dot:"uv-dot",chartdiv:"uv-chart-div",circleticks:"circle-ticks",download:"uv-download-options"},t.constants.downloads={downloadLabel:"Download"},t.types={},t.addChart=function(e,a){t.types[e]=a},t.addChart("Bar","BarGraph"),t.addChart("Line","LineGraph"),t.addChart("StackedBar","StackedBarGraph"),t.addChart("StepUpBar","StepUpBarGraph"),t.addChart("Area","AreaGraph"),t.addChart("StackedArea","StackedAreaGraph"),t.addChart("PercentBar","PercentBarGraph"),t.addChart("PercentArea","PercentAreaGraph"),t.addChart("Pie","PieGraph"),t.addChart("Donut","DonutGraph"),t.addChart("Waterfall","WaterfallGraph"),t.addChart("PolarArea","PolarAreaGraph"),t.chart=function(e,a,n){return void 0!==t.types[e]?new t[t.types[e]](a,n):void 0},t.effects={},t.effects.bar={},t.effects.bar.mouseover=function(e,a){var n=e.config,r=e.categories[a],o=e.labels[a],s=function(){e.frame.selectAll("rect.cr-"+t.util.formatClassName(r)).transition().duration(n.effects.hover).style("fill",n.effects.hovercolor).style("stroke",n.effects.strokecolor),n.effects.showhovertext&&e.frame.selectAll("text.cr-"+t.util.formatClassName(r)).transition().duration(n.effects.hover).style("fill",n.effects.textcolor).style("opacity",1)};return"categories"===n.legend.legendtype?e.effects[r].mouseover=s:e.effects[o].mouseover=s,s},t.effects.bar.mouseout=function(e,a,n){var r=e.config,o=e.categories[a],s=t.util.getColorBand(e.config,a),i=n||t.util.getColorBand(e.config,a),l=e.labels[a],c=function(){e.frame.selectAll("rect.cr-"+t.util.formatClassName(o)).transition().duration(r.effects.hover).style("fill",s).style("stroke","none"),e.frame.selectAll("text.cr-"+t.util.formatClassName(o)).transition().duration(r.effects.hover).style("fill",e.config.label.showlabel?i:"none")};return"categories"===r.legend.legendtype?e.effects[o].mouseout=c:e.effects[l].mouseout=c,c},t.effects.area={},t.effects.area.mouseover=function(e,a){var n=e.config,r=e.categories[a],o=function(){e.frame.selectAll(".cge-"+t.util.formatClassName(r)).select("path."+t.constants.classes.area+t.util.formatClassName(r)).transition().duration(n.effects.hover).style("fill",n.effects.hovercolor)};return e.effects[r].mouseover=o,o},t.effects.area.mouseout=function(e,a){var n=e.config,r=e.categories[a],o=function(){e.frame.selectAll(".cge-"+t.util.formatClassName(r)).select("path."+t.constants.classes.area+t.util.formatClassName(r)),e.frame.selectAll(".cge-"+t.util.formatClassName(r)).select("path."+t.constants.classes.area+t.util.formatClassName(r)).transition().duration(n.effects.hover).style("fill",t.util.getColorBand(n,a))};return e.effects[r].mouseout=o,o},t.effects.line={},t.effects.line.mouseover=function(e,a){var n=e.config,r=e.categories[a],o=function(){e.frame.selectAll(".cge-"+t.util.formatClassName(r)).selectAll("circle").transition().duration(n.effects.hover).style("fill",n.effects.hovercolor).style("fill-opacity",1).style("stroke",n.effects.hovercolor),e.frame.selectAll(".cge-"+t.util.formatClassName(r)).select("path").transition().duration(n.effects.hover).style("stroke",n.effects.hovercolor),n.effects.showhovertext&&e.frame.selectAll(".cge-"+t.util.formatClassName(r)).selectAll("text").transition().duration(n.effects.hover).style("fill",n.effects.textcolor)};return e.effects[r].mouseover=o,o},t.effects.line.mouseout=function(e,a,n){var r=e.config,o=e.categories[a],s=n||t.util.getColorBand(e.config,a),i=function(){e.frame.selectAll(".cge-"+t.util.formatClassName(o)).selectAll("circle").transition().duration(r.effects.hover).style("fill",s).style("fill-opacity",.6).style("stroke","#fff"),e.frame.selectAll(".cge-"+t.util.formatClassName(o)).select("path").transition().duration(r.effects.hover).style("stroke",s),e.frame.selectAll(".cge-"+t.util.formatClassName(o)).selectAll("text").transition().duration(r.effects.hover).style("fill",e.config.label.showlabel?s:"none")};return e.effects[o].mouseout=i,i},t.effects.caption={},t.effects.caption.mouseover=function(e){return function(){d3.select(this.parentNode.parentNode).select("."+t.constants.classes.hoverbg).transition().duration(e.effects.duration).style("fill",e.caption.hovercolor)}},t.effects.caption.mouseout=function(e){return function(){d3.select(this.parentNode.parentNode).select("."+t.constants.classes.hoverbg).transition().duration(e.effects.duration).style("fill",e.graph.bgcolor)}},t.effects.donut={},t.effects.donut.mouseover=function(t,e,a,n){return function(n){var r={x:e.centroid(n)[0]/5,y:e.centroid(n)[1]/5};d3.select(this.parentNode).transition().duration(a.effects.duration).attr("transform","translate("+(t.x+r.x)+","+(t.y+r.y)+")")}},t.effects.donut.mouseout=function(t,e){return function(){d3.select(this.parentNode).transition().duration(e.effects.duration).attr("transform","translate("+t.x+","+t.y+")")}},t.effects.pie={},t.effects.pie.mouseover=function(t,e,a,n){var r=function(t){var r={x:a.centroid(t)[0]/5,y:a.centroid(t)[1]/5};d3.select(this.parentNode).transition().duration(n.effects.duration).attr("transform","translate("+(e.x+r.x)+","+(e.y+r.y)+")")};return r},t.effects.pie.mouseout=function(t,e,a){var n=function(){d3.select(this.parentNode).transition().duration(a.effects.duration).attr("transform","translate("+e.x+","+e.y+")")};return n},t.effects.legend={},t.effects.legend.mouseover=function(t,e){return"categories"===t.config.legend.legendtype?t.effects.group[t.categories[e]].mouseover:t.effects.group[t.labels[e]].mouseover},t.effects.legend.mouseout=function(t,e){return"categories"===t.config.legend.legendtype?t.effects.group[t.categories[e]].mouseout:t.effects.group[t.labels[e]].mouseout},t.effects.legend.click=function(e,a,n){var r="false"===d3.select(a).attr("disabled")?!1:!0;n.toggleGraphGroup(e),d3.select(a).select("rect").style("fill",r?t.util.getColorBand(n.config,e):t.config.legend.inactivecolor),d3.select(a).select("text").style("fill",r?null:t.config.legend.inactivecolor),d3.select(a).attr("disabled",r?"false":"true")},t.palette={Default:["#7E6DA1","#C2CF30","#FF8900","#FE2600","#E3003F","#8E1E5F","#FE2AC2","#CCF030","#9900EC","#3A1AA8","#3932FE","#3276FF","#35B9F6","#42BC6A","#91E0CB"],Plain:["#B1EB68","#B1B9B5","#FFA16C","#9B64E7","#CEE113","#2F9CFA","#CA6877","#EC3D8C","#9CC66D","#C73640","#7D9532","#B064DC"],Android:["#33B5E5","#AA66CC","#99CC00","#FFBB33","#FF4444","#0099CC","#9933CC","#669900","#FF8800","#CC0000"],Soft:["#9ED8D2","#FFD478","#F16D9A","#A8D59D","#FDC180","#F05133","#EDED8A","#F6A0A5","#9F218B"],Simple:["#FF8181","#FFB081","#FFE081","#EFFF81","#BFFF81","#90FF81","#81FFA2","#81FFD1","#9681FF","#C281FF","#FF81DD"],Egypt:["#3A3E04","#784818","#FCFCA8","#C03C0C","#F0A830","#A8783C","#FCFCFC","#FCE460","#540C00","#C0C084","#3C303C","#1EA34A","#606C54","#F06048"],Olive:["#18240C","#3C6C18","#60A824","#90D824","#A8CC60","#789C60","#CCF030","#B4CCA8","#D8F078","#40190D","#E4F0CC"],Candid:["#AF5E14","#81400C","#E5785D","#FEBFBF","#A66363","#C7B752","#EFF1A7","#83ADB7","#528F98","#BCEDF5","#446B3D","#8BD96F","#E4FFB9"],Sulphide:["#594440","#0392A7","#FFC343","#E2492F","#007257","#B0BC4A","#2E5493","#7C2738","#FF538B","#A593A1","#EBBA86","#E2D9CA"],Lint:["#A8A878","#F0D89C","#60909C","#242418","#E49C30","#54483C","#306090","#C06C00","#C0C0C0","#847854","#6C3C00","#9C3C3C","#183C60","#FCCC00","#840000","#FCFCFC"]},t.Graph=function(e,a){var n=this;return n.id=t.util.getUniqueId(),n.graphdef=null,n.config=null,n.frame=null,n.panel=null,n.chart=null,n.bg=null,n.effects={},n.axes={hor:{group:null,scale:null,func:null,axis:null,line:null,label:null},ver:{group:null,scale:null,func:null,axis:null,line:null,label:null},meta:{min:null,max:null}},n.labels=null,n.categories=null,n.graphdef=e,n.config=t.util.extend({},t.config,a),this},t.Graph.prototype.init=function(){var t=this;return t.max().min().position(t.config.meta.position||"body").setDimensions().setFrame().setPanel().setBackground().setCaption().setSubCaption().setMetadata().setHorizontalAxis().setVerticalAxis().setEffectsObject(),t.config.meta.isDownloadable&&t.setDownloadOptions(),t.config.legend.showlegends&&t.setLegend(),t},t.Graph.prototype.setDimensions=function(){var t=this;return t.height(t.config.dimension.height).width(t.config.dimension.width).top(t.config.margin.top).bottom(t.config.margin.bottom).left(t.config.margin.left).right(t.config.margin.right),this},t.Graph.prototype.setDownloadOptions=function(){if(t.util.isDownloadSupported()){var e=this;e.download=e.panel.append("g").classed(t.constants.classes.download,!0),e.download.append("text").classed(t.constants.classes.download,!0).text(e.config.meta.downloadLabel).attr("y",-e.config.margin.top/2).attr("x",e.config.dimension.width-25).attr("text-anchor",e.config.caption.textanchor).style("font-family",e.config.caption.fontfamily).style("font-size","12").style("cursor",e.config.caption.cursor).style("stroke",e.config.caption.strokecolor).style("text-decoration","underline").on("mouseover",function(){var t=d3.select(this);t.style("color","#0000FF")}).on("mouseout",function(){var t=d3.select(this);t.style("color","#8D8D8D")}).on("click",function(){var a=d3.select(this);a.style("display","none"),t.util.svgToPng(e,function(){a.style("display",null)})})}},t.Graph.prototype.setFrame=function(){var e=this;return e.frame||(e.frame=d3.select(e.position()||"body").append("div").classed(t.constants.classes.chartdiv,!0).style("display","inline-block").style("width","100%").style("height","100%").append("svg")),e.frame.attr("id",t.constants.classes.uv+"-"+e.id).classed(t.constants.classes.frame,!0),e.config.graph.responsive===!0?e.frame.attr("width","100%").attr("height","100%").attr("preserveAspectRatio",e.config.graph.align+" "+e.config.graph.meetOrSlice).attr("viewBox","0 0 "+(e.width()+e.left()+e.right())+" "+(e.height()+e.top()+e.bottom())):e.frame.attr("width",e.width()+e.left()+e.right()).attr("height",e.height()+e.top()+e.bottom()),e.frame.append("rect").classed(t.constants.classes.framebg,!0).attr("width",e.width()+e.left()+e.right()).attr("height",e.height()+e.top()+e.bottom()).style("fill",e.config.frame.bgcolor),this},t.Graph.prototype.setPanel=function(){var e=this;return e.panel||(e.panel=e.frame.append("g")),e.panel.attr("id",t.constants.classes.panel+"-"+e.id).classed(t.constants.classes.panel,!0).attr("transform","translate("+e.left()+","+e.top()+")"),this},t.Graph.prototype.setBackground=function(e){var a=this;return a.bg||(a.bg=a.panel.append("rect").classed(t.constants.classes.bg,!0).attr("height",a.height()).attr("width",a.width())),a.bg.style("fill",e||a.config.graph.bgcolor),a.chart=a.panel.append("g").classed(t.constants.classes.chart,!0).style("opacity",a.config.graph.opacity),this},t.Graph.prototype.setCaption=function(){var e=this;return e.caption=e.panel.append("g").classed(t.constants.classes.caption,!0),e.caption.append("text").classed(t.constants.classes.captiontext,!0).text(e.config.meta.caption).attr("y",-e.config.margin.top/2).attr("x",e.config.dimension.width/2).attr("text-anchor",e.config.caption.textanchor).style("font-family",e.config.caption.fontfamily).style("font-size",e.config.caption.fontsize).style("font-weight",e.config.caption.fontweight).style("font-variant",e.config.caption.fontvariant).style("text-decoration",e.config.caption.textdecoration).on("mouseover",t.effects.caption.mouseover(e.config)).on("mouseout",t.effects.caption.mouseout(e.config)),this},t.Graph.prototype.setSubCaption=function(){var e=this;return e.subCaption=e.panel.append("g").classed(t.constants.classes.subcaption,!0),e.subCaption.append("text").classed(t.constants.classes.subcaptiontext,!0).text(e.config.meta.subcaption).attr("y",-e.config.margin.top/2+1*e.config.caption.fontsize).attr("x",e.config.dimension.width/2).attr("text-anchor",e.config.caption.textanchor).style("font-family",e.config.subCaption.fontfamily).style("font-size",e.config.subCaption.fontsize).style("font-weight",e.config.subCaption.fontweight).style("font-variant",e.config.subCaption.fontvariant).style("text-decoration",e.config.subCaption.textdecoration),this},t.Graph.prototype.setMetadata=function(){var e=this;return e.labels=t.util.getLabelArray(e.graphdef),e.categories=t.util.getCategoryArray(e.graphdef),this},t.Graph.prototype.setHorizontalAxis=function(){{var e=this;e.graphdef}return e.axes.hor.group||(e.axes.hor.group=e.panel.append("g").classed(t.constants.classes.horaxis,!0).attr("transform","translate(0,"+e.height()+")").style("shape-rendering","crispEdges")),"Horizontal"===e.config.graph.orientation?(e.axes.hor.scale=d3.scale[e.config.scale.type]().domain(["log"===e.config.scale.type?1:e.min(),e.max()]).range([0,e.width()]),e.axes.hor.scale.nice&&e.axes.hor.scale.nice(),e.config.axis.showsubticks||(e.config.axis.subticks=0),e.axes.hor.func=d3.svg.axis().scale(e.axes.hor.scale).ticks(e.config.axis.ticks).tickSize(-e.height(),e.config.axis.minor,0).tickPadding(e.config.axis.padding).tickSubdivide(e.config.axis.subticks).orient("bottom")):(e.axes.hor.scale=d3.scale.ordinal().rangeRoundBands([0,e.width()],e.config.scale.ordinality),e.axes.hor.func=d3.svg.axis().scale(e.axes.hor.scale).tickPadding(e.config.axis.padding).orient("bottom"),e.config.axis.showtext&&e.config.axis.showhortext||e.axes.hor.func.tickSize(0)),e.config.axis.showtext&&e.config.axis.showhortext||e.axes.hor.func.tickFormat(function(t){return""}),this},t.Graph.prototype.setVerticalAxis=function(){{var e=this;e.graphdef}return e.axes.ver.group||(e.axes.ver.group=e.panel.append("g").classed(t.constants.classes.veraxis,!0).style("shape-rendering","crispEdges")),"Vertical"===e.config.graph.orientation?(e.axes.ver.scale=d3.scale[e.config.scale.type]().domain([e.max(),"log"===e.config.scale.type?1:e.min()]).range([0,e.height()]),e.axes.ver.scale.nice&&e.axes.ver.scale.nice(),e.config.axis.showsubticks||(e.config.axis.subticks=0),e.axes.ver.func=d3.svg.axis().scale(e.axes.ver.scale).ticks(e.config.axis.ticks).tickSize(-e.width(),e.config.axis.minor,0).tickPadding(e.config.axis.padding).tickSubdivide(e.config.axis.subticks).orient("left")):(e.axes.ver.scale=d3.scale.ordinal().rangeRoundBands([0,e.height()],e.config.scale.ordinality),e.axes.ver.func=d3.svg.axis().scale(e.axes.ver.scale).tickPadding(e.config.axis.padding).orient("left"),e.config.axis.showtext&&e.config.axis.showvertext||e.axes.ver.func.tickSize(0)),e.config.axis.showtext&&e.config.axis.showvertext||e.axes.ver.func.tickFormat(function(t){return""}),this},t.Graph.prototype.setEffectsObject=function(){for(var t=this,e="categories"===t.config.legend.legendtype?t.categories:t.labels,a=0;a<e.length;a++)t.effects[e[a]]={};return t},t.Graph.prototype.drawHorizontalAxis=function(){var e=this;return e.axes.hor.axis=e.axes.hor.group.append("g").style("font-family",e.config.label.fontfamily).style("font-size",e.config.label.fontsize).style("font-weight",e.config.label.fontweight).call(e.axes.hor.func),e.config.axis.showticks&&e.axes.hor.axis.selectAll("line").style("stroke",e.config.axis.strokecolor).style("opacity",e.config.axis.opacity),e.axes.hor.axis.selectAll("path").style("fill","none"),e.axes.hor.line=e.panel.append("line").classed(t.constants.classes.horaxis,!0).attr("y1","Horizontal"===e.config.graph.orientation?e.height():e.axes.ver.scale(0)).attr("y2","Horizontal"===e.config.graph.orientation?e.height():e.axes.ver.scale(0)).attr("x1","0").attr("x2",e.width()).style("stroke",e.config.axis.strokecolor),e.axes.hor.label=e.axes.hor.group.append("g").classed(t.constants.classes.axeslabelgroup,!0).attr("transform","translate("+e.width()/2+","+(1*e.config.margin.bottom/4+1*e.config.label.fontsize)+")"),e.axes.hor.label.append("text").attr("display","block").classed(t.constants.classes.axeslabel,!0).classed("cal",!0).attr("text-anchor","middle").style("font-size",e.config.axis.fontsize).style("font-family",e.config.axis.fontfamily).text(e.config.meta.hlabel),e.axes.hor.label.append("text").attr("display","block").attr("y",1*e.config.axis.fontsize).attr(t.constants.classes.axessublabel,!0).classed("casl",!0).attr("text-anchor","middle").style("font-size",e.config.axis.fontsize-2).style("font-family",e.config.axis.fontfamily).text(e.config.meta.hsublabel),this},t.Graph.prototype.drawVerticalAxis=function(){var e=this;return e.axes.ver.axis=e.axes.ver.group.append("g").classed(t.constants.classes.axes,!0).style("font-family",e.config.label.fontfamily).style("font-size",e.config.label.fontsize).style("font-weight",e.config.label.fontweight).call(e.axes.ver.func),e.config.axis.showticks&&e.axes.ver.axis.selectAll("line").style("stroke",e.config.axis.strokecolor).style("opacity",e.config.axis.opacity),e.axes.ver.axis.selectAll("path").style("fill","none"),e.axes.ver.line=e.panel.append("line").classed(t.constants.classes.veraxis,!0).attr("x1","Horizontal"===e.config.graph.orientation?e.axes.hor.scale(0):0).attr("x2","Horizontal"===e.config.graph.orientation?e.axes.hor.scale(0):0).attr("y1",0).attr("y2",e.height()).style("stroke",e.config.axis.strokecolor),e.axes.ver.label=e.axes.ver.group.append("g").attr("transform","translate("+-4*e.config.margin.left/5+","+e.height()/2+")rotate(270)"),e.axes.ver.label.append("text").classed(t.constants.classes.axeslabel,!0).attr("text-anchor","middle").classed("cal",!0).style("font-family",e.config.axis.fontfamily).style("font-size",e.config.axis.fontsize).text(e.config.meta.vlabel),e.axes.ver.label.append("text").classed(t.constants.classes.axessublabel,!0).attr("text-anchor","middle").attr("y",+e.config.axis.fontsize).classed("casl",!0).style("font-family",e.config.axis.fontfamily).style("font-size",e.config.axis.fontsize-2).text(e.config.meta.vsublabel),this},t.Graph.prototype.setLegend=function(){var e=this,a=e.panel.append("g").classed(t.constants.classes.legend,!0).attr("transform",function(t,a){if("right"===e.config.legend.position)return"translate("+e.width()+", 10)";if("bottom"===e.config.legend.position){var n=e.height()+e.config.margin.bottom/2+Number(e.config.axis.fontsize);return"translate(0, "+n+")"}});return e.legends=a.selectAll("g").data("categories"===e.config.legend.legendtype?e.categories:e.labels),e.legends.enter().append("g").attr("transform",function(t,a){if("right"===e.config.legend.position)return"translate(10,"+10*(2*a-1)+")";if("bottom"===e.config.legend.position){var n=100*a-e.config.dimension.width*e.config.legend.legendstart,r=20*e.config.legend.legendstart;return n>=e.config.dimension.width&&(e.config.legend.legendstart=e.config.legend.legendstart+1,n=100*a-e.config.dimension.width*e.config.legend.legendstart,r=20*e.config.legend.legendstart),"translate("+n+","+r+")"}}).attr("class",function(a,n){var r="categories"===e.config.legend.legendtype?e.categories[n]:e.labels[n];return t.util.getClassName(this,"cl-"+r)}).attr("disabled","false").on("mouseover",function(t,a){e.effects[t].mouseover&&"function"==typeof e.effects[t].mouseover&&e.effects[t].mouseover()}).on("mouseout",function(t,a){e.effects[t].mouseout&&"function"==typeof e.effects[t].mouseout&&e.effects[t].mouseout()}).on("click",function(a,n){t.effects.legend.click(n,this,e)}),e.legends.append("rect").classed(t.constants.classes.legendsign,!0).attr("height",e.config.legend.symbolsize).attr("width",e.config.legend.symbolsize).style("fill",function(a,n){return t.util.getColorBand(e.config,n)}).style("stroke","none"),e.legends.append("text").classed(t.constants.classes.legendlabel,!0).text(function(t,a){return"categories"===e.config.legend.legendtype?e.categories[a]:e.labels[a]}).attr("dx",e.config.legend.textmargin).attr("dy",".71em").attr("text-anchor","start").style("stroke",e.config.legend.color).style("fill",e.config.legend.color).style("stroke-width",e.config.legend.strokewidth).style("font-family",e.config.legend.fontfamily).style("font-size",e.config.legend.fontsize).style("font-weight",e.config.legend.fontweight),this},t.Graph.prototype.finalize=function(t){var e=this;return e.drawHorizontalAxis().drawVerticalAxis(),e.frame.selectAll("text").style("cursor","default"),console.log(e),this},t.Graph.prototype.remove=function(){return this.frame.remove(),this},t.Graph.prototype.removeCaption=function(){return this.caption.remove(),this},t.Graph.prototype.removeLegend=function(){return this.legends[0]&&this.legends[0].parentNode.remove(),this},t.Graph.prototype.removePanel=function(){return this.panel.remove(),this},t.Graph.prototype.removeHorAxis=function(){return this.panel.selectAll("g."+t.constants.classes.horaxis+" >*").remove(),this.panel.selectAll("line."+t.constants.classes.horaxis).remove(),this},t.Graph.prototype.removeVerAxis=function(){return this.panel.selectAll("g."+t.constants.classes.veraxis+" >*").remove(),this.panel.selectAll("line."+t.constants.classes.veraxis).remove(),this},t.Graph.prototype.width=function(t){return t?(this.config.dimension.width=t,this):this.config.dimension.width},t.Graph.prototype.height=function(t){return t?(this.config.dimension.height=t,this):this.config.dimension.height},t.Graph.prototype.top=function(t){return t?(this.config.margin.top=t,this):this.config.margin.top},t.Graph.prototype.bottom=function(t){return t?(this.config.margin.bottom=t,this):this.config.margin.bottom},t.Graph.prototype.left=function(t){return t?(this.config.margin.left=t,this):this.config.margin.left},t.Graph.prototype.right=function(t){return t?(this.config.margin.right=t,this):this.config.margin.right},t.Graph.prototype.position=function(t){return t?(this.config.meta.position=t,this):this.config.meta.position},t.Graph.prototype.caption=function(t){return t?(this.config.meta.caption=t,this):this.config.meta.caption},t.Graph.prototype.subCaption=function(t){return t?(this.config.meta.subCaption=t,this):this.config.meta.caption},t.Graph.prototype.isDownloadable=function(t){return t?(this.config.meta.isDownload=t,this):this.config.meta.isDownload},t.Graph.prototype.max=function(){return null!==this.axes.meta.max?this.axes.meta.max:(this.axes.meta.max=t.util.getMax(this.graphdef,this.graphdef.stepup),this)},t.Graph.prototype.min=function(){return null!==this.axes.meta.min?this.axes.meta.min:(this.axes.meta.min=t.util.getMin(this.graphdef,this.graphdef.stepup),this)},t.Graph.prototype.toggleGraphGroup=function(e){{var a=this,n=a.categories[e],r=a.frame.select("g.cge-"+t.util.formatClassName(n)).style("display");t.util.getColorBand(a.config,e)}return a.frame.selectAll("g.cge-"+t.util.formatClassName(n)).style("display","none"===r?null:"none"),this},t.AreaGraph=function(e,a){var n=this;t.Graph.call(n,e,a).setDefaults().init(),n.areagroups=[],n.dataset=t.util.getDataArray(n.graphdef);var r,o,s,i,l=n.graphdef.dataset[n.graphdef.categories[0]];for(n.axes["Horizontal"===n.config.graph.orientation?"ver":"hor"].scale.domain(l.map(function(t){return t.name})),s=0,i=n.dataset.length;i>s;s+=1)o=n.chart.append("g").classed("cg-"+t.util.formatClassName(n.categories[s]),!0).append("g").classed("cge-"+t.util.formatClassName(n.categories[s]),!0).datum(n.dataset[s]),r={path:o,linefunc:void 0,areafunc:void 0,line:void 0,area:void 0},n["draw"+n.config.graph.orientation+"Area"](r,s),n.areagroups.push(r);n.finalize()},t.AreaGraph.prototype=t.util.inherits(t.Graph),t.AreaGraph.prototype.setDefaults=function(){var t=this;return t.graphdef.stepup="normal",this},t.AreaGraph.prototype.drawHorizontalArea=function(e,a){var n=this,r=t.util.getColorBand(n.config,a);n.axes.ver.scale.rangePoints([0,n.height()]),e.linefunc=d3.svg.line().x(function(t){return n.axes.hor.scale(t.value)}).y(function(t){return n.axes.ver.scale(t.name)+n.axes.ver.scale.rangeBand()/2}).interpolate(n.config.area.interpolation),e.areafunc=d3.svg.area().x0(n.axes.hor.scale(0)).x1(e.linefunc.x()).y(e.linefunc.y()).interpolate(n.config.area.interpolation),e.area=e.path.append("svg:path").classed(t.constants.classes.areapath+a,!0).attr("d",e.areafunc).style("opacity",n.config.area.opacity).style("-moz-opacity",n.config.area.opacity).style("fill",r),e.line=e.path.append("svg:path").classed(t.constants.classes.linepath+a,!0).attr("d",e.linefunc).style("stroke","white").style("fill","none"),e.path.selectAll("."+t.constants.classes.dot).data(n.dataset[a]).enter().append("circle").classed(t.constants.classes.dot,!0).attr("cx",e.linefunc.x()).attr("cy",e.linefunc.y()).attr("r",3.5).style("fill","white");
  
  },t.AreaGraph.prototype.drawVerticalArea=function(e,a){var n=this,r=t.util.getColorBand(n.config,a);n.axes.hor.scale.rangePoints([0,n.width()]),e.linefunc=d3.svg.line().x(function(t){return n.axes.hor.scale(t.name)+n.axes.hor.scale.rangeBand()/2}).y(function(t){return n.axes.ver.scale(t.value)}).interpolate(n.config.area.interpolation),e.areafunc=d3.svg.area().x(e.linefunc.x()).y0(e.linefunc.y()).y1(n.axes.ver.scale(0)).interpolate(n.config.area.interpolation),e.area=e.path.append("svg:path").classed(t.constants.classes.areapath+a,!0).attr("d",e.areafunc).style("opacity",n.config.area.opacity).style("-moz-opacity",n.config.area.opacity).style("fill",r),e.line=e.path.append("svg:path").classed(t.constants.classes.linepath+a,!0).attr("d",e.linefunc).style("stroke","white").style("fill","none"),e.path.selectAll("."+t.constants.classes.dot).data(n.dataset[a]).enter().append("circle").classed(t.constants.classes.dot,!0).attr("cx",e.linefunc.x()).attr("cy",e.linefunc.y()).attr("r",3.5).style("fill","white")},t.BarGraph=function(e,a){var n=this;t.Graph.call(n,e,a).setDefaults().init(),n.bargroups={},n.axes["Horizontal"===n.config.graph.orientation?"ver":"hor"].scale.domain(n.labels);var r,o,s=n.categories.length;for(r=0;s>r;r+=1)o=n.categories[r],n.bargroups[o]=n.chart.append("g").classed("cg-"+t.util.formatClassName(o),!0),n["draw"+n.config.graph.orientation+"Bars"](r);n.finalize()},t.BarGraph.prototype=t.util.inherits(t.Graph),t.BarGraph.prototype.setDefaults=function(){var t=this;return t.graphdef.stepup="normal",this},t.BarGraph.prototype.drawHorizontalBars=function(e){var a=this,n=t.util.getColorBand(this.config,e),r=a.categories.length,o=a.bargroups[a.categories[e]].selectAll("g").data(a.graphdef.dataset[a.categories[e]]).enter().append("g").classed("cge-"+t.util.formatClassName(a.categories[e]),!0).attr("transform",function(t){return t.value<0?"scale(-1,1)":void 0});o.append("rect").classed(t.util.formatClassName(a.categories[e]),!0).classed("cr-"+t.util.formatClassName(a.categories[e]),!0).attr("height",a.axes.ver.scale.rangeBand()/r).attr("x",function(t){return t.value<0?-a.axes.hor.scale(0):a.axes.hor.scale(0)}).attr("y",function(t){return a.axes.ver.scale(t.name)}).attr("width",0).style("stroke",a.config.bar.strokecolor).style("fill",n).transition().duration(a.config.effects.duration).delay(function(t,e){return e*a.config.effects.duration}).attr("width",function(t){return a.axes.hor.scale(Math.abs(t.value))-a.axes.hor.scale(0)}).call(t.util.endAll,function(n,r){d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseover",t.effects.bar.mouseover(a,e)),d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseout",t.effects.bar.mouseout(a,e)),"function"==typeof a.config.graph.clickCallback&&d3.select(this.parentNode.parentNode).selectAll("rect").on("click",function(t){a.config.graph.clickCallback.apply(null,[t])})}),o.append("text").attr("x",function(t){return a.axes.hor.scale(0)}).attr("y",function(t){return a.axes.ver.scale(t.name)+a.axes.ver.scale.rangeBand()/r/2}).attr("dx",function(t){return t.value<0?"-20px":"4px"}).attr("dy",".35em").attr("text-anchor","start").classed("cr-"+t.util.formatClassName(a.categories[e]),!0).style("fill",a.config.label.showlabel?t.util.getColorBand(a.config,e):"none").style("font-family",a.config.bar.fontfamily).style("font-size",a.config.bar.fontsize).style("font-weight",a.config.bar.fontweight).style("transform",function(t){return t.value<0?"scale(-1,1)":"scale(1,1)"}).style("opacity",0).text(function(e){return t.util.getLabelValue(a,e)}).transition().duration(a.config.effects.duration).delay(function(t,e){return e*a.config.effects.duration}).style("opacity",1).attr("x",function(t){return a.axes.hor.scale(t.value)}),o.append("svg:title").text(function(n,r){return t.util.getTooltipText(a,a.categories[e],a.labels[r],n)}),a.bargroups[a.categories[e]].attr("transform","translate(0,"+e*a.axes.ver.scale.rangeBand()/r+")")},t.BarGraph.prototype.drawVerticalBars=function(e){var a=this,n=t.util.getColorBand(this.config,e),r=a.categories.length,o=a.bargroups[a.categories[e]].selectAll("g").data(a.graphdef.dataset[a.categories[e]]).enter().append("g").classed("cge-"+t.util.formatClassName(a.categories[e]),!0).attr("transform",function(t){return t.value<0?"scale(1, -1)":void 0});o.append("rect").classed(t.util.formatClassName(a.categories[e]),!0).classed("cr-"+t.util.formatClassName(a.categories[e]),!0).attr("height",0).attr("width",a.axes.hor.scale.rangeBand()/r).attr("x",function(t){return a.axes.hor.scale(t.name)}).attr("y",function(t){return(t.value<0?-1:1)*(a.height()-a.axes.ver.scale(0))}).style("stroke",a.config.bar.strokecolor).style("fill",n).transition().duration(a.config.effects.duration).delay(e*a.config.effects.duration).attr("height",function(t){return Math.abs(a.axes.ver.scale(0)-a.axes.ver.scale(t.value))}).call(t.util.endAll,function(n,r){d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseover",t.effects.bar.mouseover(a,e)),d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseout",t.effects.bar.mouseout(a,e)),"function"==typeof a.config.graph.clickCallback&&d3.select(this.parentNode.parentNode).selectAll("rect").on("click",function(t){a.config.graph.clickCallback.apply(null,[t])})}),o.append("text").attr("transform",function(t){return t.value<0?"scale(1,1)":"scale(1,-1)"}).attr("x",function(t){return a.axes.hor.scale(t.name)+a.axes.hor.scale.rangeBand()/r/2}).attr("y",function(t){return a.height()-a.axes.ver.scale(0)}).attr("dx",0).attr("dy",function(t){return t.value<0?"2em":".35em"}).attr("text-anchor","middle").classed("cr-"+t.util.formatClassName(a.categories[e]),!0).style("fill",a.config.label.showlabel?t.util.getColorBand(a.config,e):"none").style("font-family",a.config.bar.fontfamily).style("font-size",a.config.bar.fontsize).style("font-weight",a.config.bar.fontweight).style("opacity",0).text(function(e){return t.util.getLabelValue(a,e)}).transition().duration(a.config.effects.duration).delay(e*a.config.effects.duration).style("opacity",1).attr("y",function(t){return-(a.height()-a.axes.ver.scale(t.value))-10}),o.append("svg:title").text(function(n,r){return t.util.getTooltipText(a,a.categories[e],a.labels[r],n)}),a.bargroups[a.categories[e]].attr("transform","translate("+e*a.axes.hor.scale.rangeBand()/r+","+a.height()+") scale(1,-1)")},t.DonutGraph=function(e,a){var n=this;t.Graph.call(n,e,a).setDefaults().init(),n.radius=2*Math.min(n.height(),n.width())/5,n.center={x:n.width()/2,y:n.height()/2},n.category=e.categories[0];var r=t.util.getCategoryData(n.graphdef,[n.category]),o=d3.svg.arc().innerRadius(n.radius*n.config.donut.factor).outerRadius(n.radius),s=d3.layout.pie();n.chart.data(r),n.arcs=n.chart.selectAll("g.arc").data(s).enter().append("g").classed(t.constants.classes.arc+t.util.formatClassName(n.category),!0).attr("transform","translate("+n.center.x+","+n.center.y+")"),n.arcs.append("path").attr("d",o).style("fill",function(e,a){return t.util.getColorBand(n.config,a)}).style("stroke",n.config.donut.strokecolor).style("stroke-width",n.config.donut.strokewidth).on("mouseover",t.effects.donut.mouseover(n.center,o,n.config)).on("mouseout",t.effects.donut.mouseout(n.center,n.config)),"function"==typeof n.config.graph.clickCallback&&n.arcs.on("click",function(t){n.config.graph.clickCallback.apply(null,[t])}),n.arcs.append("text").attr("transform",function(t){return"translate("+o.centroid(t)+")"}).attr("dy",".35em").attr("text-anchor","middle").style("fill",n.config.label.showlabel?n.config.donut.fontfill:"none").style("font-family",n.config.donut.fontfamily).style("font-size",n.config.donut.fontsize).style("font-weight",n.config.donut.fontweight).style("font-variant",n.config.donut.fontvariant).text(function(e){return t.util.getLabelValue(n,e)}),n.arcs.append("svg:title").text(function(e,a){return t.util.getTooltipText(n,n.category,n.labels[a],e)})},t.DonutGraph.prototype=t.util.inherits(t.Graph),t.DonutGraph.prototype.setDefaults=function(){var t=this;return t.graphdef.stepup="normal",this},t.LineGraph=function(e,a){var n=this;t.Graph.call(n,e,a).setDefaults().init(),n.linegroups={},n.dataset=t.util.getDataArray(n.graphdef);var r,o,s,i=n.categories.length,l=n.labels;for(n.axes["Horizontal"===n.config.graph.orientation?"ver":"hor"].scale.domain(l),s=0;i>s;s+=1)o=n.chart.append("g").classed("cg-"+t.util.formatClassName(n.categories[s]),!0).append("g").classed("cge-"+t.util.formatClassName(n.categories[s]),!0).datum(n.dataset[s]),r={path:o,func:void 0},n["draw"+n.config.graph.orientation+"Lines"](r,s),n.linegroups[n.categories[s]]=r;n.finalize()},t.LineGraph.prototype=t.util.inherits(t.Graph),t.LineGraph.prototype.setDefaults=function(){var t=this;return t.graphdef.stepup="normal",t.config.scale.ordinality=0,this},t.LineGraph.prototype.drawHorizontalLines=function(e,a){var n=this,r=n.axes,o=(n.config,t.util.getColorBand(n.config,a));return n.axes.ver.scale.rangePoints([0,n.height()]),e.func=d3.svg.line().x(function(t){return r.hor.scale(t.value)}).y(function(t){return r.ver.scale(t.name)+r.ver.scale.rangeBand()/2}).interpolate(t.config.line.interpolation),e.path.append("path").classed("cr-"+t.util.formatClassName(n.categories[a]),!0).attr("d",e.func).style("fill","none").style("stroke",o).style("stroke-width",n.config.line.strokewidth).style("stroke-opacity",n.config.line.strokeopacity).transition().duration(3*n.config.effects.duration).delay(2*a*n.config.effects.duration).style("stroke-opacity",1).call(t.util.endAll,function(e,r){d3.select(this.parentNode.parentNode).selectAll("path").on("mouseover",t.effects.line.mouseover(n,a)),d3.select(this.parentNode.parentNode).selectAll("path").on("mouseout",t.effects.line.mouseout(n,a)),d3.select(this.parentNode.parentNode).selectAll("circle").on("mouseover",t.effects.line.mouseover(n,a)),d3.select(this.parentNode.parentNode).selectAll("circle").on("mouseout",t.effects.line.mouseout(n,a))}),n.config.line.showcircles&&e.path.selectAll("circle").data(n.dataset[a]).enter().append("circle").classed("cr-"+t.util.formatClassName(n.categories[a]),!0).attr("cx",e.func.x()).attr("cy",e.func.y()).attr("r",n.config.line.circleradius).style("fill",o).style("fill-opacity",n.config.line.circleopacity).style("stroke","#fff").append("svg:title").text(function(e,r){return t.util.getTooltipText(n,n.categories[a],n.labels[r],e)}),e.path.selectAll("text").data(n.dataset[a]).enter().append("text").attr("x",function(t){return r.hor.scale(t.value)}).attr("y",function(t){return r.ver.scale(t.name)+r.ver.scale.rangeBand()/2}).attr("dx",10).attr("dy",".35em").attr("text-anchor","start").style("opacity",0).classed("cr-"+t.util.formatClassName(n.categories[a]),!0).style("fill",n.config.label.showlabel?t.util.getColorBand(n.config,a):"none").style("font-family",n.config.line.fontfamily).style("font-size",n.config.line.fontsize).style("font-weight",n.config.line.fontweight).text(function(e){return t.util.getLabelValue(n,e)}).transition().duration(3*n.config.effects.duration).delay(2*a*n.config.effects.duration).style("opacity",1),this},t.LineGraph.prototype.drawVerticalLines=function(e,a){var n=this,r=n.axes,o=(n.config,t.util.getColorBand(n.config,a));return n.axes.hor.scale.rangePoints([0,n.width()]),e.func=d3.svg.line().x(function(t){return r.hor.scale(t.name)+r.hor.scale.rangeBand()/2}).y(function(t){return r.ver.scale(t.value)}).interpolate(t.config.line.interpolation),e.path.append("path").attr("d",e.func).classed("cr-"+t.util.formatClassName(n.categories[a]),!0).style("fill","none").style("stroke",o).style("stroke-width",n.config.line.strokewidth).style("stroke-opacity",n.config.line.strokeopacity).transition().duration(n.config.effects.duration).delay(2*a*n.config.effects.duration).style("stroke-opacity",1).call(t.util.endAll,function(e,r){d3.select(this.parentNode.parentNode).selectAll("path").on("mouseover",t.effects.line.mouseover(n,a)),d3.select(this.parentNode.parentNode).selectAll("path").on("mouseout",t.effects.line.mouseout(n,a)),d3.select(this.parentNode.parentNode).selectAll("circle").on("mouseover",t.effects.line.mouseover(n,a)),d3.select(this.parentNode.parentNode).selectAll("circle").on("mouseout",t.effects.line.mouseout(n,a))}),n.config.line.showcircles&&e.path.selectAll("circle").data(n.dataset[a]).enter().append("circle").attr("cx",e.func.x()).attr("cy",e.func.y()).attr("r",n.config.line.circleradius).classed("cr-"+t.util.formatClassName(n.categories[a]),!0).style("fill",o).style("fill-opacity",n.config.line.circleopacity).style("stroke","#fff").append("svg:title").text(function(e,r){return t.util.getTooltipText(n,n.categories[a],n.labels[r],e)}),e.path.selectAll("text").data(n.dataset[a]).enter().append("text").attr("x",function(t){return r.hor.scale(t.name)+r.hor.scale.rangeBand()/2}).attr("y",function(t){return r.ver.scale(t.value)-20}).attr("dx",0).attr("dy",".71em").attr("text-anchor","middle").classed("cr-"+t.util.formatClassName(n.categories[a]),!0).style("fill",n.config.label.showlabel?t.util.getColorBand(n.config,a):"none").style("font-family",n.config.line.fontfamily).style("font-size",n.config.line.fontsize).style("font-weight",n.config.line.fontweight).style("opacity",0).text(function(e){return t.util.getLabelValue(n,e)}).transition().duration(3*n.config.effects.duration).delay(2*a*n.config.effects.duration).style("opacity",1),this},t.PercentAreaGraph=function(e,a){var n=this;t.Graph.call(n,e,a).setDefaults().init();{var r=d3.layout.stack().offset("zero")(n.categories.map(function(t){return e.dataset[t].map(function(t){return{x:t.name,y:+t.value}})})),o=n.labels;n.categories}n.axes["Horizontal"===n.config.graph.orientation?"ver":"hor"].scale.domain(o),n.areagroup=n.chart.selectAll("g.areagroup").data(r).enter().append("g").attr("class",function(e,a){return t.util.getClassName(this,"cge-"+n.categories[a])}),n["draw"+n.config.graph.orientation+"Area"](),n.finalize(!0)},t.PercentAreaGraph.prototype=t.util.inherits(t.Graph),t.PercentAreaGraph.prototype.setDefaults=function(){var t=this;return t.graphdef.stepup="percent",this},t.PercentAreaGraph.prototype.drawHorizontalArea=function(){var e=this,a=e.axes,n=e.categories,r=e.config,o=t.util.getSumUpArray(e.graphdef);a.ver.scale.rangePoints([0,e.height()]);for(var s=0;s<n.length;s+=1)t.effects.area.mouseover(e,s),t.effects.area.mouseout(e,s);e.areagroup.append("path").attr("class",function(e,a){return t.util.getClassName(this,t.constants.classes.area+t.util.formatClassName(n[a]))}).style("fill",function(e,a){return t.util.getColorBand(r,a)}).attr("d",d3.svg.area().y(function(t){return a.ver.scale(t.x)+a.ver.scale.rangeBand()/2}).x0(function(e,n){return a.hor.scale(t.util.getPercentage(e.y0,o[n]))}).x1(function(e,n){return a.hor.scale(t.util.getPercentage(e.y0+e.y,o[n]))}).interpolate(e.config.area.interpolation)).on("mouseover",function(t,a){e.effects[n[a]].mouseover()}).on("mouseout",function(t,a){e.effects[n[a]].mouseout()}),e.areagroup.append("path").attr("class",function(e,a){return t.util.getClassName(this,t.constants.classes.line+t.util.formatClassName(n[a]))}).style("stroke","white").style("fill","none").style("stroke-width",2).attr("d",d3.svg.line().y(function(t){return a.ver.scale(t.x)+a.ver.scale.rangeBand()/2}).x(function(e,n){return a.hor.scale(t.util.getPercentage(e.y0+e.y,o[n]))}).interpolate(e.config.area.interpolation))},t.PercentAreaGraph.prototype.drawVerticalArea=function(){var e=this,a=e.axes,n=e.categories,r=e.config,o=t.util.getSumUpArray(e.graphdef);a.hor.scale.rangePoints([0,e.width()]);for(var s=0;s<n.length;s+=1)t.effects.area.mouseover(e,s),t.effects.area.mouseout(e,s);e.areagroup.append("path").attr("class",function(e,a){return t.util.getClassName(this,t.constants.classes.area+t.util.formatClassName(n[a]))}).style("fill",function(e,a){return t.util.getColorBand(r,a)}).attr("d",d3.svg.area().x(function(t){return a.hor.scale(t.x)+a.hor.scale.rangeBand()/2}).y0(function(e,n){return a.ver.scale(t.util.getPercentage(e.y0,o[n]))}).y1(function(e,n){return a.ver.scale(t.util.getPercentage(e.y0+e.y,o[n]))}).interpolate(e.config.area.interpolation)).on("mouseover",function(t,a){e.effects[n[a]].mouseover()}).on("mouseout",function(t,a){e.effects[n[a]].mouseout()}),e.areagroup.append("path").attr("class",function(e,a){return t.util.getClassName(this,t.constants.classes.line+t.util.formatClassName(n[a]))}).style("stroke","white").style("fill","none").style("stroke-width",2).attr("d",d3.svg.line().x(function(t,e){return a.hor.scale(t.x)+a.hor.scale.rangeBand()/2}).y(function(e,n){return a.ver.scale(t.util.getPercentage(e.y0+e.y,o[n]))}).interpolate(e.config.area.interpolation))},t.PercentBarGraph=function(e,a){var n=this;t.Graph.call(n,e,a).setDefaults().init(),n.bargroups=[];var r,o,s,i,l,c=n.labels,f=c.map(function(t){return 0}),u=c.map(function(t){return 0});for(n.axes["Horizontal"===n.config.graph.orientation?"ver":"hor"].scale.domain(c),s=0,i=n.categories.length;i>s;s+=1)l=t.util.getColorBand(n.config,s),r=n.chart.append("g").classed("cg-"+n.categories[s],!0),o=r.selectAll("g").data(n.graphdef.dataset[n.categories[s]]).enter().append("g").classed("cge-"+t.util.formatClassName(n.categories[s]),!0),n["draw"+t.util.getPascalCasedName(n.config.graph.orientation)+"Bars"](o,f,u,s),"Vertical"===n.config.graph.orientation&&r.attr("transform","translate(0,"+2*n.height()+") scale(1,-1)"),n.bargroups.push(r);n.finalize()},t.PercentBarGraph.prototype=t.util.inherits(t.Graph),t.PercentBarGraph.prototype.setDefaults=function(){var t=this;return t.graphdef.stepup="percent",t.config.scale.ordinality=0,this},t.PercentBarGraph.prototype.drawHorizontalBars=function(e,a,n,r){var o=this,s=this.axes,i=t.util.getColorBand(this.config,r),l=(this.config,t.util.getSumUpArray(this.graphdef));e.append("rect").attr("height",s.ver.scale.rangeBand()).attr("width",0).attr("x",function(e,n){var r=s.hor.scale(t.util.getPercentage(a[n],l[n]));return a[n]+=e.value,r}).attr("y",function(t){return s.ver.scale(t.name)}).classed("cr-"+t.util.formatClassName(o.categories[r]),!0).style("stroke","none").style("fill",i).transition().duration(t.config.effects.duration).delay(r*t.config.effects.duration).attr("width",function(e,a){return s.hor.scale(t.util.getPercentage(e.value,l[a]))}).call(t.util.endAll,function(e,a){d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseover",t.effects.bar.mouseover(o,r,o.config.effects.textcolor)),d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseout",t.effects.bar.mouseout(o,r,o.config.effects.textcolor))}),e.append("text").attr("y",function(t){return s.ver.scale(t.name)+s.ver.scale.rangeBand()/2}).attr("dx",0).attr("dy",".35em").attr("text-anchor","end").classed("cr-"+t.util.formatClassName(o.categories[r]),!0).style("fill",o.config.label.showlabel?o.config.effects.textcolor:"none").style("font-family",this.config.bar.fontfamily).style("font-size",this.config.bar.fontsize).style("font-weight",this.config.bar.fontweight).text(function(e,n){return s.hor.scale(t.util.getPercentage(a[n],l[n]))>15?String(Math.round(t.util.getPercentage(e.value,l[n]))):null}).transition().duration(t.config.effects.duration).delay(r*t.config.effects.duration).attr("x",function(e,a){return n[a]+=e.value,s.hor.scale(t.util.getPercentage(n[a],l[a]))-5})},t.PercentBarGraph.prototype.drawVerticalBars=function(e,a,n,r){var o=this,s=this.height(),i=this.axes,l=t.util.getColorBand(this.config,r),c=(this.config,t.util.getSumUpArray(this.graphdef));e.append("rect").attr("height",0).attr("width",i.hor.scale.rangeBand()).attr("x",function(t){return i.hor.scale(t.name)}).attr("y",function(e,n){var r=i.ver.scale(t.util.getPercentage(a[n],c[n]));return a[n]-=e.value,r}).classed("cr-"+t.util.formatClassName(o.categories[r]),!0).style("stroke","none").style("fill",l).transition().duration(t.config.effects.duration).delay(r*t.config.effects.duration).attr("height",function(e,a){return s-i.ver.scale(t.util.getPercentage(e.value,c[a]))}).call(t.util.endAll,function(e,a){d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseover",t.effects.bar.mouseover(o,r,o.config.effects.textcolor)),d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseout",t.effects.bar.mouseout(o,r,o.config.effects.textcolor))}),e.append("text").attr("transform","scale(1,-1)").attr("x",function(t){return i.hor.scale(t.name)+i.hor.scale.rangeBand()/2}).attr("y",-s+5).attr("dy",".71em").attr("text-anchor","middle").classed("cr-"+t.util.formatClassName(o.categories[r]),!0).style("fill",o.config.label.showlabel?o.config.effects.textcolor:"none").style("font-family",this.config.bar.fontfamily).style("font-size",this.config.bar.fontsize).style("font-weight",this.config.bar.fontweight).text(function(e,a){return s-i.ver.scale(t.util.getPercentage(e.value,c[a]))>15?String(Math.round(t.util.getPercentage(e.value,c[a]))):null}).transition().duration(t.config.effects.duration).delay(r*t.config.effects.duration).attr("y",function(e,a){return n[a]+=e.value,-(2*s-i.ver.scale(t.util.getPercentage(n[a],c[a])))+5})},t.PieGraph=function(e,a){var n=this;t.Graph.call(n,e,a).setDefaults().init(),n.radius=2*Math.min(n.height(),n.width())/5,n.center={x:n.width()/2,y:n.height()/2},n.category=e.categories[0];var r=t.util.getCategoryData(n.graphdef,[n.category]),o=d3.svg.arc().innerRadius(0).outerRadius(n.radius),s=d3.layout.pie();n.chart.data(r),n.arcs=n.chart.selectAll("g.arc").data(s).enter().append("g").classed(t.constants.classes.arc+t.util.formatClassName(n.category),!0).attr("class",function(e,a){return t.util.getClassName(this,"cge-"+n.labels[a])}).attr("transform","translate("+n.center.x+","+n.center.y+")"),n.arcs.append("path").attr("d",o).style("fill",function(e,a){return t.util.getColorBand(n.config,a)}).style("stroke",n.config.pie.strokecolor).style("stroke-width",n.config.pie.strokewidth).on("mouseover",t.effects.pie.mouseover(n,n.center,o,n.config)).on("mouseout",t.effects.pie.mouseout(n,n.center,n.config)),n.arcs.append("text").attr("transform",function(t){return"translate("+o.centroid(t)+")"}).attr("dy",".35em").attr("text-anchor","middle").style("fill",n.config.label.showlabel?n.config.donut.fontfill:"none").style("font-family",n.config.pie.fontfamily).style("font-size",n.config.pie.fontsize).style("font-weight",n.config.pie.fontweight).style("font-variant",n.config.pie.fontvariant).text(function(e){return t.util.getLabelValue(n,e)}),n.arcs.append("svg:title").text(function(e,a){return t.util.getTooltipText(n,n.category,n.labels[a],e)}),"function"==typeof n.config.graph.clickCallback&&n.arcs.on("click",function(t){n.config.graph.clickCallback.apply(null,[t])})},t.PieGraph.prototype=t.util.inherits(t.Graph),t.PieGraph.prototype.setDefaults=function(){var t=this;return t.graphdef.stepup="normal",t.config.legend.legendtype="labels",this},t.PolarAreaGraph=function(e,a){var n=this;t.Graph.call(n,e,a).setDefaults().init(),n.maxRadius=2*Math.min(n.height(),n.width())/5,n.center={x:n.width()/2,y:n.height()/2},n.category=n.categories[0];for(var r=t.util.getCategoryData(n.graphdef,[n.category]),o=r[0].map(function(t,e){return t}),s=d3.layout.pie().value(function(t){return n.max()/r[0].length}),i=[],l=d3.svg.arc().innerRadius(0).outerRadius(function(t,e){return o[e]*n.maxRadius/n.max()}),c=1;c<=n.config.axis.ticks;c++)i[c]=n.maxRadius/n.config.axis.ticks*c;n.chart.data(r),n.arcs=n.chart.selectAll("g.arc").data(s).enter().append("g").classed(t.constants.classes.arc+t.util.formatClassName(n.category),!0).attr("transform","translate("+n.center.x+","+n.center.y+")"),n.arcs.append("path").attr("d",l).style("fill",function(e,a){return t.util.getColorBand(n.config,a)}).style("stroke",n.config.pie.strokecolor).style("stroke-width",n.config.pie.strokewidth),n.arcs.append("svg:title").text(function(e,a){return t.util.getTooltipText(n,n.category,n.labels[a],e)}),n.chart.selectAll("."+t.constants.classes.circleticks).data(i).enter().append("svg:g").classed(t.constants.classes.circleticks,!0).append("svg:circle").attr("r",function(t,e){return t}).style("stroke",n.config.axis.strokecolor).style("opacity",n.config.axis.opacity).style("fill","none").attr("transform","translate("+n.center.x+","+n.center.y+")"),"function"==typeof n.config.graph.clickCallback&&n.arcs.on("click",function(t){n.config.graph.clickCallback.apply(null,[t])})},t.PolarAreaGraph.prototype=t.util.inherits(t.Graph),t.PolarAreaGraph.prototype.setDefaults=function(){var t=this;return t.graphdef.stepup="normal",this},t.StackedAreaGraph=function(e,a){var n=this;t.Graph.call(n,e,a).setDefaults().init();var r=d3.layout.stack().offset(n.config.area.offset)(n.categories.map(function(t){return e.dataset[t].map(function(t){return{x:t.name,y:+t.value}})}));n.axes["Horizontal"===n.config.graph.orientation?"ver":"hor"].scale.domain(n.labels.map(function(t){return t})),n.areagroup=n.chart.append("g").selectAll("g").data(r).enter().append("g").attr("class",function(e,a){return t.util.getClassName(this,"cge-"+n.categories[a])}),n["draw"+n.config.graph.orientation+"Area"](),n.finalize()},t.StackedAreaGraph.prototype=t.util.inherits(t.Graph),t.StackedAreaGraph.prototype.setDefaults=function(){var t=this;return t.graphdef.stepup="stepup",this},t.StackedAreaGraph.prototype.drawHorizontalArea=function(){var e=this,a=e.axes,n=e.categories,r=e.config;a.ver.scale.rangePoints([0,e.height()]);for(var o=0;o<n.length;o+=1)t.effects.area.mouseover(e,o),t.effects.area.mouseout(e,o);return e.areagroup.append("path").attr("class",function(e,a){return t.util.getClassName(this,t.constants.classes.area+n[a])}).style("fill",function(e,a){return t.util.getColorBand(r,a)}).attr("d",d3.svg.area().y(function(t){return a.ver.scale(t.x)+a.ver.scale.rangeBand()/2}).x0(function(t){return a.hor.scale(t.y0)}).x1(function(t){return a.hor.scale(t.y0+t.y)}).interpolate(e.config.area.interpolation)).on("mouseover",function(t,a){e.effects[n[a]].mouseover()}).on("mouseout",function(t,a){e.effects[n[a]].mouseout()}),e.areagroup.append("path").attr("class",function(e,a){return t.util.getClassName(this,t.constants.classes.line+n[a])}).style("stroke","white").style("fill","none").style("stroke-width",2).attr("d",d3.svg.line().y(function(t){return a.ver.scale(t.x)+a.ver.scale.rangeBand()/2}).x(function(t){return a.hor.scale(t.y0+t.y)}).interpolate(e.config.area.interpolation)),e},t.StackedAreaGraph.prototype.drawVerticalArea=function(){var e=this,a=e.axes,n=e.categories,r=e.config;a.hor.scale.rangePoints([0,e.width()]);for(var o=0;o<n.length;o+=1)t.effects.area.mouseover(e,o),t.effects.area.mouseout(e,o);return e.areagroup.append("path").attr("class",function(e,a){return t.util.getClassName(this,t.constants.classes.area+n[a])}).style("fill",function(e,a){return t.util.getColorBand(r,a)}).attr("d",d3.svg.area().x(function(t){return a.hor.scale(t.x)+a.hor.scale.rangeBand()/2}).y0(function(t){return a.ver.scale(t.y0)}).y1(function(t){return a.ver.scale(t.y0+t.y)}).interpolate(e.config.area.interpolation)).on("mouseover",function(t,a){e.effects[n[a]].mouseover()}).on("mouseout",function(t,a){e.effects[n[a]].mouseout()}),e.areagroup.append("path").attr("class",function(e,a){return t.util.getClassName(this,t.constants.classes.line+n[a])}).style("stroke","white").style("fill","none").style("stroke-width",2).attr("d",d3.svg.line().x(function(t){return a.hor.scale(t.x)+a.hor.scale.rangeBand()/2}).y(function(t){return a.ver.scale(t.y0+t.y)}).interpolate(e.config.area.interpolation)),e},t.StackedBarGraph=function(e,a){var n=this;t.Graph.call(n,e,a).setDefaults().init(),n.bargroups={};var r,o,s=n.labels,i=s.map(function(t){return 0}),l=s.map(function(t){return 0});for(n.axes["Horizontal"===n.config.graph.orientation?"ver":"hor"].scale.domain(s),r=0,o=n.categories.length;o>r;r+=1)n.bargroups[n.categories[r]]=n.chart.append("g").classed("cg-"+t.util.formatClassName(n.categories[r]),!0),n["draw"+n.config.graph.orientation+"Bars"](r,i,l);n.finalize()},t.StackedBarGraph.prototype=t.util.inherits(t.Graph),t.StackedBarGraph.prototype.setDefaults=function(){var t=this;return t.graphdef.stepup="stepup",this},t.StackedBarGraph.prototype.drawHorizontalBars=function(e,a,n){var r=this,o=this.axes,s=t.util.getColorBand(this.config,e),i=this.config,l=this.bargroups[this.categories[e]],c=l.selectAll("g").data(this.graphdef.dataset[r.categories[e]]).enter().append("g").classed("cge-"+t.util.formatClassName(r.categories[e]),!0);c.append("rect").attr("height",o.ver.scale.rangeBand()).attr("width",0).attr("x",function(t,e){var n=o.hor.scale(a[e]);return a[e]+=t.value,n}).attr("y",function(t){return o.ver.scale(t.name)}).classed("cr-"+t.util.formatClassName(r.categories[e]),!0).style("stroke","none").style("fill",s).transition().duration(t.config.effects.duration).delay(e*t.config.effects.duration).attr("width",function(t,e){return o.hor.scale(a[e])-o.hor.scale(a[e]-t.value)}).each("end",function(a,n){d3.select(this).on("mouseover",t.effects.bar.mouseover(r,e,r.config.effects.textcolor)),d3.select(this).on("mouseout",t.effects.bar.mouseout(r,e,r.config.effects.textcolor)),"function"==typeof r.config.graph.clickCallback&&d3.select(this).on("click",function(t){r.config.graph.clickCallback.apply(null,[t])})}),c.append("text").attr("y",function(t){return o.ver.scale(t.name)+o.ver.scale.rangeBand()/2}).attr("dx",0).attr("dy",".35em").attr("text-anchor","end").classed("cr-"+t.util.formatClassName(r.categories[e]),!0).style("fill",r.config.label.showlabel?r.config.effects.textcolor:"none").style("font-family",i.bar.fontfamily).style("font-size",i.bar.fontsize).style("font-weight",i.bar.fontweight).style("opacity",0).text(function(e){return o.hor.scale(e.value)>15?t.util.getLabelValue(r,e):null}).transition().duration(t.config.effects.duration).delay(e*t.config.effects.duration).style("opacity",1).attr("x",function(t,e){return n[e]+=t.value,o.hor.scale(n[e])-5}),c.append("svg:title").text(function(a,n){return t.util.getTooltipText(r,r.categories[e],r.labels[n],a)})},t.StackedBarGraph.prototype.drawVerticalBars=function(e,a,n){var r=this,o=this.height(),s=this.axes,i=t.util.getColorBand(this.config,e),l=this.config,c=this.bargroups[r.categories[e]],f=c.selectAll("g").data(this.graphdef.dataset[r.categories[e]]).enter().append("g").classed("cge-"+t.util.formatClassName(r.categories[e]),!0);f.append("rect").attr("height",0).attr("width",s.hor.scale.rangeBand()).attr("x",function(t){return s.hor.scale(t.name)}).attr("y",function(t,e){var n=s.ver.scale(a[e]);return a[e]-=t.value,n}).classed("cr-"+t.util.formatClassName(r.categories[e]),!0).style("stroke","none").style("fill",i).transition().duration(t.config.effects.duration).delay(e*t.config.effects.duration).attr("height",function(t,e){return-(s.ver.scale(-a[e])-s.ver.scale(-a[e]-t.value))}).each("end",function(a,n){d3.select(this).on("mouseover",t.effects.bar.mouseover(r,e,r.config.effects.textcolor)),d3.select(this).on("mouseout",t.effects.bar.mouseout(r,e,r.config.effects.textcolor)),"function"==typeof r.config.graph.clickCallback&&d3.select(this).on("click",function(t){r.config.graph.clickCallback.apply(null,[t])})}),f.append("text").attr("transform","scale(1,-1)").attr("x",function(t){return s.hor.scale(t.name)+s.hor.scale.rangeBand()/2}).attr("y",-o+5).attr("dy",".71em").attr("text-anchor","middle").classed("cr-"+t.util.formatClassName(r.categories[e]),!0).style("fill",r.config.label.showlabel?r.config.effects.textcolor:"none").style("font-family",l.bar.fontfamily).style("font-size",l.bar.fontsize).style("font-weight",l.bar.fontweight).style("opacity",0).text(function(e){return o-s.ver.scale(e.value)>15?t.util.getLabelValue(r,e):null}).transition().duration(t.config.effects.duration).delay(e*t.config.effects.duration).style("opacity",1).attr("y",function(t,e){return n[e]+=t.value,-(2*o-s.ver.scale(n[e]))+5}),f.append("svg:title").text(function(a,n){return t.util.getTooltipText(r,r.categories[e],r.labels[n],a)}),c.attr("transform","translate(0,"+2*this.height()+") scale(1,-1)")},t.StepUpBarGraph=function(e,a){var n=this;t.Graph.call(n,e,a).setDefaults().init(),this.bargroups={};var r,o=n.categories.length,s=n.labels.map(function(t){
  return 0}),i=n.labels.map(function(t){return 0});for(n.axes["Horizontal"===this.config.graph.orientation?"ver":"hor"].scale.domain(this.labels),r=0;o>r;r+=1)n.bargroups[n.categories[r]]=this.chart.append("g").classed("cg-"+t.util.formatClassName(n.categories[r]),!0),n["draw"+n.config.graph.orientation+"Bars"](r,s,i);n.finalize()},t.StepUpBarGraph.prototype=t.util.inherits(t.Graph),t.StepUpBarGraph.prototype.setDefaults=function(){var t=this;return t.graphdef.stepup="stepup",this},t.StepUpBarGraph.prototype.drawHorizontalBars=function(e,a,n){var r=this,o=r.categories.length,s=t.util.getColorBand(r.config,e),i=r.bargroups[r.categories[e]],l=i.selectAll("g").data(r.graphdef.dataset[r.categories[e]]).enter().append("g").classed("cge-"+t.util.formatClassName(r.categories[e]),!0);l.append("rect").attr("height",r.axes.ver.scale.rangeBand()/o).attr("width",0).attr("x",function(t,e){var n=r.axes.hor.scale(a[e]);return a[e]+=t.value,t.value<0?-n:n}).attr("y",function(t){return r.axes.ver.scale(t.name)}).classed("cr-"+t.util.formatClassName(r.categories[e]),!0).style("stroke","none").style("fill",s).style("transform",function(t){return t.value<0?"scale(-1,1)":"scale(1,1)"}).transition().duration(r.config.effects.duration).delay(e*r.config.effects.duration).attr("width",function(t,e){return Math.abs(r.axes.hor.scale(a[e])-r.axes.hor.scale(a[e]-t.value))}).call(t.util.endAll,function(a,n){d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseover",t.effects.bar.mouseover(r,e)),d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseout",t.effects.bar.mouseout(r,e))}),l.append("text").attr("y",function(t){return r.axes.ver.scale(t.name)+r.axes.ver.scale.rangeBand()/o/2}).attr("dx",function(t){return t.value<0?-16:4}).attr("dy",".35em").attr("text-anchor","start").classed("cr-"+t.util.formatClassName(r.categories[e]),!0).style("fill",r.config.label.showlabel?t.util.getColorBand(r.config,e):"none").style("opacity",0).style("font-family",r.config.bar.fontfamily).style("font-size",r.config.bar.fontsize).style("font-weight",r.config.bar.fontweight).text(function(e){return t.util.getLabelValue(r,e)}).transition().duration(r.config.effects.duration).delay(e*r.config.effects.duration).style("opacity",1).attr("x",function(t,e){return n[e]+=t.value,r.axes.hor.scale(n[e])}),l.append("svg:title").text(function(a,n){return t.util.getTooltipText(r,r.categories[e],r.labels[n],a)}),i.attr("transform","translate(0,"+e*r.axes.ver.scale.rangeBand()/o+")")},t.StepUpBarGraph.prototype.drawVerticalBars=function(e,a,n){var r=this,o=r.categories.length,s=t.util.getColorBand(r.config,e),i=r.bargroups[r.categories[e]],l=i.selectAll("g").data(r.graphdef.dataset[r.categories[e]]).enter().append("g").classed("cge-"+t.util.formatClassName(r.categories[e]),!0);l.append("rect").attr("height",0).attr("width",r.axes.hor.scale.rangeBand()/o).attr("x",function(t){return r.axes.hor.scale(t.name)}).attr("y",function(t,e){var n=2*r.height()-r.axes.ver.scale(a[e]);return a[e]+=t.value,t.value<0?-n:n}).classed("cr-"+t.util.formatClassName(r.categories[e]),!0).style("stroke","none").style("fill",s).style("transform",function(t){return t.value<0?"scale(1,-1)":"scale(1,1)"}).transition().duration(r.config.effects.duration).delay(e*r.config.effects.duration).attr("height",function(t,e){return Math.abs(r.axes.ver.scale(-a[e])-r.axes.ver.scale(-a[e]-t.value))}).call(t.util.endAll,function(a,n){d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseover",t.effects.bar.mouseover(r,e)),d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseout",t.effects.bar.mouseout(r,e))}),l.append("text").attr("transform","scale(1,-1)").attr("x",function(t){return r.axes.hor.scale(t.name)+r.axes.hor.scale.rangeBand()/o/2}).attr("y",-r.height()-10).attr("dy",function(t){return t.value<0?"2.3em":".71em"}).attr("text-anchor","middle").classed("cr-"+t.util.formatClassName(r.categories[e]),!0).style("fill",r.config.label.showlabel?t.util.getColorBand(r.config,e):"none").style("font-family",r.config.bar.fontfamily).style("font-size",r.config.bar.fontsize).style("font-weight",r.config.bar.fontweight).style("opacity",0).text(function(e){return t.util.getLabelValue(r,e)}).transition().duration(r.config.effects.duration).delay(e*r.config.effects.duration).style("opacity",1).attr("y",function(t,e){return n[e]+=t.value,-(2*r.height()-r.axes.ver.scale(n[e]))-10}),l.append("svg:title").text(function(a,n){return t.util.getTooltipText(r,r.categories[e],r.labels[n],a)}),i.attr("transform","translate("+e*r.axes.hor.scale.rangeBand()/o+","+2*r.height()+") scale(1,-1)")},t.Table=function(){this.caption=void 0,this.position=void 0,this.graphdef=void 0,this.table=void 0,this.header=void 0,this.body=void 0,this.bodyrows={}},t.Table.prototype.init=function(e,a){this.graphdef=e,this.config=t.util.extend({},a),this.position=this.config.meta.pos||"body",this.table=d3.select(this.position).append("table").classed(this.config.table.tableclass,!0),this.header=this.table.append("thead").classed(this.config.table.headerclass,!0),this.body=this.table.append("tbody").classed(this.config.table.bodyclass,!0),this.footer=this.table.append("tfoot").classed(this.config.table.footerclass,!0)},t.Table.prototype.finalize=function(){},t.TableGraph=function(e,a){t.Table.apply(this,[e]),this.init(e,a),"Horizontal"===this.config.graph.orientation?this.setHorTable():this.setVerTable(),this.finalize()},t.TableGraph.prototype=t.util.inherits(t.Table),t.TableGraph.prototype.setHorTable=function(){var e=this.graphdef.categories,a=t.util.getTabularArray(this.graphdef);e.unshift(""),this.header.append("tr").selectAll("td").data(e).enter().append("td").text(function(t){return t}),e.shift(),this.bodyrows=this.body.selectAll("tr").data(a).enter().append("tr"),this.bodyrows.selectAll("td").data(function(t,e){return a[e]}).enter().append("td").attr("class",function(t,e){var a=0===e?"chart3rtablelabel":"chart3rtabledata";return d3.select(this).attr("class")+a}).text(function(t){return t})},t.TableGraph.prototype.setVerTable=function(){var e=t.util.getLabelArray(this.graphdef),a=this.graphdef.dataset;e.unshift(""),this.header.append("tr").selectAll("td").data(e).enter().append("td").text(function(t){return t}),e.shift(),this.bodyrows=this.body.selectAll("tr").data(this.graphdef.categories).enter().append("tr"),this.bodyrows.selectAll("td").data(function(t){var e,n,r=[];for(r.push(t),e=0,n=a[t].length;n>e;e+=1)r.push(a[t][e].value);return r}).enter().append("td").attr("class",function(t,e){var a=0===e?"chart3rtablelabel":"chart3rtabledata";return d3.select(this).attr("class")+a}).text(function(t){return t})},t.WaterfallGraph=function(e,a){var n=this;t.Graph.call(n,e,a).setDefaults().init(),n.bargroups={},n.axes["Horizontal"===n.config.graph.orientation?"ver":"hor"].scale.domain(n.labels);{var r;n.categories.length}r=n.categories[0],n.bargroups[r]=n.chart.append("g").classed("cg-"+t.util.formatClassName(r),!0),n["draw"+n.config.graph.orientation+"Bars"](0),n.finalize()},t.WaterfallGraph.prototype=t.util.inherits(t.Graph),t.WaterfallGraph.prototype.setDefaults=function(){var t=this;return t.graphdef.stepup="waterfall",t.config.legend.showlegends=!1,this},t.WaterfallGraph.prototype.drawHorizontalBars=function(e){var a=this,n=a.categories.length,r=t.util.getColorBand(a.config,e),o=a.bargroups[a.categories[e]],s=0,i=0,l=o.selectAll("g").data(a.graphdef.dataset[a.categories[e]]).enter().append("g").classed("cge-"+t.util.formatClassName(a.categories[e]),!0);l.append("rect").attr("height",a.axes.ver.scale.rangeBand()/n-2).attr("width",0).attr("x",function(t,e){var n=t.value<0?s+t.value:s;return s+=t.value,a.axes.hor.scale(n)}).attr("y",function(t){return a.axes.ver.scale(t.name)}).classed("cr-"+t.util.formatClassName(a.categories[e]),!0).style("stroke","none").style("fill",r).transition().duration(a.config.effects.duration).delay(e*a.config.effects.duration).attr("width",function(t){return a.axes.hor.scale(Math.abs(t.value))}).call(t.util.endAll,function(n,r){d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseover",t.effects.bar.mouseover(a,e)),d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseout",t.effects.bar.mouseout(a,e))}),l.append("text").attr("y",function(t){return a.axes.ver.scale(t.name)+a.axes.ver.scale.rangeBand()/n/2}).attr("dx",4).attr("dy",".35em").attr("text-anchor","start").classed("cr-"+t.util.formatClassName(a.categories[e]),!0).style("fill",a.config.label.showlabel?t.util.getColorBand(a.config,e):"none").style("font-family",a.config.bar.fontfamily).style("font-size",a.config.bar.fontsize).style("font-weight",a.config.bar.fontweight).text(function(e){return t.util.getLabelValue(a,e)}).transition().duration(a.config.effects.duration).delay(e*a.config.effects.duration).attr("x",function(t,e){var n=t.value<0?i:i+t.value;return i+=t.value,a.axes.hor.scale(n)}),l.append("svg:title").text(function(n,r){return t.util.getTooltipText(a,a.categories[e],a.labels[r],n)}),o.attr("transform","translate(0,"+e*a.axes.ver.scale.rangeBand()/n+")")},t.WaterfallGraph.prototype.drawVerticalBars=function(e){var a=this,n=t.util.getColorBand(this.config,e),r=a.categories.length,o=0,s=0,i=a.bargroups[a.categories[e]].selectAll("g").data(a.graphdef.dataset[a.categories[e]]).enter().append("g").classed("cge-"+t.util.formatClassName(a.categories[e]),!0);i.append("rect").classed("cr-"+t.util.formatClassName(a.categories[e]),!0).attr("height",0).attr("width",0).attr("x",function(t){return a.axes.hor.scale(t.name)}).attr("y",function(t){var e=t.value<0?o+t.value:o;return o+=t.value,a.height()-a.axes.ver.scale(e)}).style("stroke",a.config.bar.strokecolor).style("fill",n).transition().duration(a.config.effects.duration).delay(e*a.config.effects.duration).attr("height",function(t){return a.height()-a.axes.ver.scale(Math.abs(t.value))}).attr("width",a.axes.hor.scale.rangeBand()/r-2).call(t.util.endAll,function(n,r){d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseover",t.effects.bar.mouseover(a,e)),d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseout",t.effects.bar.mouseout(a,e))}),i.append("text").attr("transform","scale(1,-1)").attr("x",function(t){return a.axes.hor.scale(t.name)+a.axes.hor.scale.rangeBand()/r/2}).attr("y",-10).attr("dx",0).attr("dy",".35em").attr("text-anchor","middle").classed("cr-"+t.util.formatClassName(a.categories[e]),!0).style("fill",a.config.label.showlabel?t.util.getColorBand(a.config,e):"none").style("font-family",a.config.bar.fontfamily).style("font-size",a.config.bar.fontsize).style("font-weight",a.config.bar.fontweight).text(function(e){return t.util.getLabelValue(a,e)}).transition().duration(a.config.effects.duration).delay(e*a.config.effects.duration).attr("y",function(t){s+=t.value;var e=t.value<0?s-t.value:s;return-(a.height()-a.axes.ver.scale(e))-10}),i.append("svg:title").text(function(n,r){return t.util.getTooltipText(a,a.categories[e],a.labels[r],n)}),a.bargroups[a.categories[e]].attr("transform","translate("+e*a.axes.hor.scale.rangeBand()/r+","+a.height()+") scale(1,-1)")},{chart:t.chart}}();