!function(a){"use strict";functionb(a){varb=this.internal=newc(this);b.loadConfig(a),b.init(),functiond(a,b,c){for(vareina)b[e]=a[e].bind(c),Object.keys(a[e]).length>0&&d(a[e],b[e],c)}(e,this,this)}functionc(b){varc=this;c.d3=a.d3?a.d3:"undefined"!=typeofrequire?require("d3"):void0,c.api=b,c.config=c.getDefaultConfig(),c.data={},c.cache={},c.axes={}}functiond(a,b){functionc(a,b){a.attr("transform",function(a){return"translate("+Math.ceil(b(a)+s)+", 0)"})}functiond(a,b){a.attr("transform",function(a){return"translate(0,"+Math.ceil(b(a))+")"})}functione(a){varb=a[0],c=a[a.length-1];returnc>b?[b,c]:[c,b]}functionf(a){varb,c,d=[];if(a.ticks)returna.ticks.apply(a,l);for(c=a.domain(),b=Math.ceil(c[0]);b<c[1];b++)d.push(b);returnd.length>0&&d[0]>0&&d.unshift(d[0]-(d[1]-d[0])),d}functiong(){vara,c=n.copy();returnb.isCategory&&(a=n.domain(),c.domain([a[0],a[1]-1])),c}functionh(a){returnk?k(a):a}functioni(i){i.each(function(){functioni(a){varb=n(a)+s;returnC[0]<b&&b<C[1]?p:0}vark,l,t,u=a.select(this),v=this.__chart__||n,w=this.__chart__=g(),x=r?r:f(w),y=u.selectAll(".tick").data(x,w),z=y.enter().insert("g",".domain").attr("class","tick").style("opacity",1e-6),A=y.exit().remove(),B=a.transition(y).style("opacity",1),C=n.rangeExtent?n.rangeExtent():e(n.range()),D=u.selectAll(".domain").data([0]),E=(D.enter().append("path").attr("class","domain"),a.transition(D));z.append("line"),z.append("text");varF=z.select("line"),G=B.select("line"),H=y.select("text").text(h),I=z.select("text"),J=B.select("text");switch(b.isCategory?(s=Math.ceil((w(1)-w(0))/2),l=m?0:s,t=m?s:0):s=l=0,o){case"bottom":k=c,F.attr("y2",p),I.attr("y",Math.max(p,0)+q),G.attr("x1",l).attr("x2",l).attr("y2",i),J.attr("x",0).attr("y",Math.max(p,0)+q),H.attr("dy",".71em").style("text-anchor","middle"),E.attr("d","M"+C[0]+","+j+"V0H"+C[1]+"V"+j);break;case"top":k=c,F.attr("y2",-p),I.attr("y",-(Math.max(p,0)+q)),G.attr("x2",0).attr("y2",-p),J.attr("x",0).attr("y",-(Math.max(p,0)+q)),H.attr("dy","0em").style("text-anchor","middle"),E.attr("d","M"+C[0]+","+-j+"V0H"+C[1]+"V"+-j);break;case"left":k=d,F.attr("x2",-p),I.attr("x",-(Math.max(p,0)+q)),G.attr("x2",-p).attr("y1",t).attr("y2",t),J.attr("x",-(Math.max(p,0)+q)).attr("y",s),H.attr("dy",".32em").style("text-anchor","end"),E.attr("d","M"+-j+","+C[0]+"H0V"+C[1]+"H"+-j);break;case"right":k=d,F.attr("x2",p),I.attr("x",Math.max(p,0)+q),G.attr("x2",p).attr("y2",0),J.attr("x",Math.max(p,0)+q).attr("y",0),H.attr("dy",".32em").style("text-anchor","start"),E.attr("d","M"+j+","+C[0]+"H0V"+C[1]+"H"+j)}if(w.rangeBand){varK=w,L=K.rangeBand()/2;v=w=function(a){returnK(a)+L}}elsev.rangeBand?v=w:A.call(k,w);z.call(k,v),B.call(k,w)})}varj,k,l,m,n=a.scale.linear(),o="bottom",p=6,q=3,r=null,s=0,t=!0;returnb=b||{},j=b.withOuterTick?6:0,i.scale=function(a){returnarguments.length?(n=a,i):n},i.orient=function(a){returnarguments.length?(o=ain{top:1,right:1,bottom:1,left:1}?a+"":"bottom",i):o},i.tickFormat=function(a){returnarguments.length?(k=a,i):k},i.tickCentered=function(a){returnarguments.length?(m=a,i):m},i.tickOffset=function(){returns},i.ticks=function(){returnarguments.length?(l=arguments,i):l},i.tickCulling=function(a){returnarguments.length?(t=a,i):t},i.tickValues=function(a){if("function"==typeofa)r=function(){returna(n.domain())};else{if(!arguments.length)returnr;r=a}returni},i}vare,f,g={version:"0.3.0"};g.generate=function(a){returnnewb(a)},g.chart={fn:b.prototype,internal:{fn:c.prototype}},e=g.chart.fn,f=g.chart.internal.fn,f.init=function(){vara=this,b=a.config;if(a.initParams(),b.data_url)a.convertUrlToData(b.data_url,b.data_mimeType,b.data_keys,a.initWithData);elseif(b.data_json)a.initWithData(a.convertJsonToData(b.data_json,b.data_keys));elseif(b.data_rows)a.initWithData(a.convertRowsToData(b.data_rows));else{if(!b.data_columns)throwError("url or json or rows or columns is required.");a.initWithData(a.convertColumnsToData(b.data_columns))}},f.initParams=function(){vara=this,b=a.d3,c=a.config;a.clipId="c3-"++newDate+"-clip",a.clipIdForXAxis=a.clipId+"-xaxis",a.clipIdForYAxi
})}))).values();returnc.map(b.isTimeSeries()?function(a){returnnewDate(a)}:function(a){return+a})},f.addHiddenTargetIds=function(a){this.hiddenTargetIds=this.hiddenTargetIds.concat(a)},f.removeHiddenTargetIds=function(a){this.hiddenTargetIds=this.hiddenTargetIds.filter(function(b){returna.indexOf(b)<0})},f.addHiddenLegendIds=function(a){this.hiddenLegendIds=this.hiddenLegendIds.concat(a)},f.removeHiddenLegendIds=function(a){this.hiddenLegendIds=this.hiddenLegendIds.filter(function(b){returna.indexOf(b)<0})},f.getValuesAsIdKeyed=function(a){varb={};returna.forEach(function(a){b[a.id]=[],a.values.forEach(function(c){b[a.id].push(c.value)})}),b},f.checkValueInTargets=function(a,b){varc,d,e,f=Object.keys(a);for(c=0;c<f.length;c++)for(e=a[f[c]].values,d=0;d<e.length;d++)if(b(e[d].value))return!0;return!1},f.hasNegativeValueInTargets=function(a){returnthis.checkValueInTargets(a,function(a){return0>a})},f.hasPositiveValueInTargets=function(a){returnthis.checkValueInTargets(a,function(a){returna>0})},f.isOrderDesc=function(){vara=this.config;returna.data_order&&"desc"===a.data_order.toLowerCase()},f.isOrderAsc=function(){vara=this.config;returna.data_order&&"asc"===a.data_order.toLowerCase()},f.orderTargets=function(a){varb=this,c=b.config,d=b.isOrderAsc(),e=b.isOrderDesc();returnd||e?a.sort(function(a,b){varc=function(a,b){returna+Math.abs(b.value)},e=a.values.reduce(c,0),f=b.values.reduce(c,0);returnd?f-e:e-f}):j(c.data_order)&&a.sort(c.data_order),a},f.filterByX=function(a,b){returnthis.d3.merge(a.map(function(a){returna.values})).filter(function(a){returna.x-b===0})},f.filterRemoveNull=function(a){returna.filter(function(a){returni(a.value)})},f.hasDataLabel=function(){vara=this.config;return"boolean"==typeofa.data_labels&&a.data_labels?!0:"object"==typeofa.data_labels&&r(a.data_labels)?!0:!1},f.getDataLabelLength=function(a,b,c,d){vare=this,f=[0,0],g=1.3;returne.selectChart.select("svg").selectAll(".dummy").data([a,b]).enter().append("text").text(function(a){returne.formatByAxisId(c)(a)}).each(function(a,b){f[b]=this.getBoundingClientRect()[d]*g}).remove(),f},f.isNoneArc=function(a){returnthis.hasTarget(this.data.targets,a.id)},f.isArc=function(a){return"data"ina&&this.hasTarget(this.data.targets,a.data.id)},f.findSameXOfValues=function(a,b){varc,d=a[b].x,e=[];for(c=b-1;c>=0&&d===a[c].x;c--)e.push(a[c]);for(c=b;c<a.length&&d===a[c].x;c++)e.push(a[c]);returne},f.findClosestFromTargets=function(a,b){varc,d=this;returnc=a.map(function(a){returnd.findClosest(a.values,b)}),d.findClosest(c,b)},f.findClosest=function(a,b){varc,d,e=this;returna.forEach(function(a){varf=e.dist(a,b);(c>f||!c)&&(c=f,d=a)}),d},f.dist=function(a,b){varc=this,d=c.config,e="y"===c.getAxisId(a.id)?c.y:c.y2,f=d.axis_rotated?1:0,g=d.axis_rotated?0:1;returnMath.pow(c.x(a.x)-b[f],2)+Math.pow(e(a.value)-b[g],2)},f.convertUrlToData=function(a,b,c,d){vare=this,f=b?b:"csv";e.d3.xhr(a,function(a,b){varg;g="json"===f?e.convertJsonToData(JSON.parse(b.response),c):"tsv"===f?e.convertTsvToData(b.response):e.convertCsvToData(b.response),d.call(e,g)})},f.convertXsvToData=function(a,b){varc,d=b.parseRows(a);return1===d.length?(c=[{}],d[0].forEach(function(a){c[0][a]=null})):c=b.parse(a),c},f.convertCsvToData=function(a){returnthis.convertXsvToData(a,this.d3.csv)},f.convertTsvToData=function(a){returnthis.convertXsvToData(a,this.d3.tsv)},f.convertJsonToData=function(a,b){varc,d,e=this,f=[];returnb?(c=b.value,b.x&&(c.push(b.x),e.config.data_x=b.x),f.push(c),a.forEach(function(a){varb=[];c.forEach(function(c){vard=l(a[c])?null:a[c];b.push(d)}),f.push(b)}),d=e.convertRowsToData(f)):(Object.keys(a).forEach(function(b){f.push([b].concat(a[b]))}),d=e.convertColumnsToData(f)),d},f.convertRowsToData=function(a){varb,c,d=a[0],e={},f=[];for(b=1;b<a.length;b++){for(e={},c=0;c<a[b].length;c++){if(l(a[b][c]))thrownewError("Source data is missing a component at ("+b+","+c+")!");e[d[c]]=a[b][c]}f.push(e)}returnf},f.convertColumnsToData=function(a){varb,c,d,e=[];for(b=0;b<a.length;b++)for(d=a[b][0],c=1;c<a[b].length;c++){if(l(e[c