/*
 FusionCharts JavaScript Library
 Copyright FusionCharts Technologies LLP
 License Information at <http://www.fusioncharts.com/license>

 @version 3.11.0
*/
FusionCharts.register("module",["private","modules.renderer.js-gradientlegend",function(){function t(a,b){(function r(a,u){var b,s;for(s in a)f.call(a,s)&&(b=a[s],void 0===u[s]?u[s]=b:"object"===typeof b&&null!==typeof b&&r(b,u[s]))})(a,b);return b}function R(a){return d(a?a:k)||k}function w(a){var b=a.fontSize+"";if(!b)return a;b=b.replace(/(\d+)(px)*/,"$1px");a.fontSize=b;return a}function I(a){return void 0===a||"undefined"===typeof a||null===a||a!==a?!0:!1}function m(a,b){this.carpet=a;this._componentPool=
b}function L(a){this.conf=a;this._id="GL_CARPET";this.compositionsByCategory={};this._lSpace=this.group=this.node=void 0;this.autoRecalculate=!1;this.groupName="fc-gradient-legend";this.moveInstructions={}}function A(){L.apply(this,arguments)}function O(a,b){this.rawText=a;this.conf=b;this._id="GL_CAPTION";this._lSpace=this.bound=this.node=void 0}function l(a,b){this.colorRange=a;this.conf=b;this._id="GL_BODY";this.bound=void 0;this.compositionsByCategory={};this._lSpace=void 0}function W(){l.apply(this,
arguments)}function M(a){this.conf=a;this._id="GL_LABELS"}function Y(){M.apply(this,arguments)}function S(){M.apply(this,arguments);this._id="GL_VALUES"}function Z(){S.apply(this,arguments);this._id="GL_VALUES"}function N(a){this.conf=a;this._id="FL_AXIS";this.markerLine=this.shadow=this.node=void 0;this.compositionsByCategory={}}function T(){N.apply(this,arguments)}function C(a){var b={};this._id="GL_SG1";this.conf=a;b.conf=a;this.extremes=[];this.sliders={};b.sliderGroup=this;this.valueRange=[];
this.callbacks=[];this.sliders[!1]=new P(!1,b,this._id+"_0");this.sliders[!0]=new P(!0,b,this._id+"_1")}function P(a,b,p){this.conf=b.conf;this.sliderIndex=a;this.rangeGroup=b.sliderGroup;this._id=p;this.tracker=this.node=void 0;this.currPos=0;this.swing=[]}function Q(a,b,p){p=p.components.numberFormatter;var c,q,d,ba,H,e;this.data=a;this.options=b||{};e=this.mapByPercent=!!a.mapByPercent;this.appender="";q=this.mapByPercent?0:b.min;b=this.mapByPercent?100:b.max;2===a.colorRange.length&&(c=a.colorRange[0],
d=a.colorRange[1],ba=c.value=I(c.value)?q:c.value,H=d.value=I(d.value)?b:d.value,ba===H&&(ba=c.value=q,H=d.value=b),c.displayValue=e?ba+"%":p.legendValue(ba),d.displayValue=e?H+"%":p.legendValue(H));I(q)&&I(c.value)||I(b)&&I(c.value)||!a.gradient?this._preparationGoneWrong=!0:this._preparationGoneWrong=!1;p=this.colorRange=a.colorRange.sort(function(a,b){return a.value-b.value});this.valueRatio=void 0;this.values=[];a=0;for(c=p.length;a<c;a++)this.values.push(p[a].value)}function $(){m.apply(this,
arguments)}var E=this,z=E.hcLib,v=z.pluckNumber,J=z.pluck,U=z.toRaphaelColor,aa=z.graphics,ca=z.dehashify,da=z.hashify,X=aa.convertColor,b=aa.RGBtoHex,a=aa.HEXtoRGB,c=aa.getLightColor,d=aa.getValidColor,e="rgba(192,192,192,"+(z.isIE?.002:1E-6)+")",g,k=z.COLOR_BLACK,f={}.hasOwnProperty,h,n={};g=function(){function a(u){var p=b.numberFormatter,c,r,d;c=0;for(r=u.length;c<r;c++)if(d=u[c].maxvalue)u[c].maxvalue=p.getCleanValue(d)}var b,p,r={legendCarpetConf:{spreadFactor:.85,allowDrag:!1,captionAlignment:"center",
padding:{v:3,h:3},style:{fill:"#e4d9c1",stroke:"#c4b89d"}},legendCaptionConf:{spreadFactor:.2,padding:{v:2,h:2},style:{fill:"#786B50",fontFamily:"sans-serif",fontSize:"12px",fontWeight:"bold",fontStyle:"normal"},bound:{style:{stroke:"none"}}},legendBodyConf:{spreadFactor:.8,padding:{v:2,h:2},bound:{style:{stroke:"none"}}}};r.legendAxisConf={legendAxisHeight:11,spreadFactor:.4,padding:{v:1,h:1},style:{stroke:"none","stroke-opacity":0,"stroke-width":1},line:{grooveLength:3,offset:8,style:{stroke:"rgba(255, 255, 255, 0.65)",
"stroke-width":1.5}},shadow:{style:{stroke:"none",fill:U({FCcolor:{alpha:"25,0,0",angle:360,color:"000000,FFFFFF,FFFFFF",ratio:"0,30,40"}})}},bound:{style:{stroke:"none"}}};r.sliderGroupConf={showTooltip:1,outerCircle:{rFactor:1.4,style:{fill:e,stroke:"#757575","stroke-width":3}},innerCircle:{rFactor:.65,style:{fill:e,stroke:"#FFFFFF"}}};r.axisTextItemConf={spreadFactor:.3,padding:{v:1,h:1},style:{fill:"#786B50",fontFamily:"sans-serif",fontSize:"12px",fontWeight:"normal",fontStyle:"normal"}};return{init:function(a){p=
a.chart;b=p.components},setConf:function(a){},legacyDataParser:function(p,r){var d={},H=b.numberFormatter,e,f,g,h,k,n,m,l,t;if(!p)return!1;d.mapByPercent=t=!!v(p.mapbypercent,0);void 0===p.minvalue&&(p.minvalue=void 0!==r.min?t?0:r.min:0);void 0===p.maxvalue&&(p.maxvalue=void 0!==r.max?t?100:r.max:100);e=p.color||[];g=p.code;m=d.colorRange=[];d.gradient=!!v(p.gradient,1);e.length?g=R(g):(g?(h=R(g),g=R()):(g=R(),h=c(g,1)),e.push({code:h,maxvalue:p.maxvalue,label:void 0}));a(e);e=e.sort(function(a,
b){return a.maxvalue-b.maxvalue});h=l=p.minvalue&&H.getCleanValue(p.minvalue);l=(void 0!==h||null!==h)&&(t?h+"%":H.legendValue(h));m.push({code:ca(g),value:h,displayValue:l,label:p.startlabel});g=0;for(n=e.length;g<n;g++)f=e[g],k=R(f.code||f.color),h=l=f.maxvalue,isNaN(parseInt(h,10))||(l=(void 0!==h||null!==h)&&(t?h+"%":H.legendValue(h)),m.push(Object({code:ca(k),value:h,displayValue:l,label:f.label||f.displayvalue})));m[m.length-1].label=p.endlabel||f.label;return d},getDefaultConf:function(a){return r[a]}}}();
h=function(a){var b=a.chartInstance.id,p=n[b]||(n[b]={});return function(){function c(){var a,b,u,s,q,d;for(a in p)for(b in u=p[a],u)if(s=u[b],s instanceof Array)for(q=0,d=s.length;q<d;q++)s[q]&&s[q].hide();else s.hide()}var q,d={},e;q={KEY_RECT:"rect",KEY_TEXT:"text",KEY_GROUP:"group",KEY_CIRCLE:"circle",KEY_PATH:"path"};d[q.KEY_RECT]=function(a){return e.rect(a)};d[q.KEY_TEXT]=function(a){return e.text(a)};d[q.KEY_GROUP]=function(a,b){return e.group(a,b)};d[q.KEY_CIRCLE]=function(a){return e.circle(a)};
d[q.KEY_PATH]=function(a,b){return e.path(a,b)};return{init:function(a){e=a;c()},emptyPool:function(){p=n[b]={}},getChart:function(){return a},getComponent:function(a,b,u){var s=p[a],c,q,r,e=0;s||(s=p[a]={});return(q=s[b])&&!(q instanceof Array)||q instanceof Array&&0<q.length?function(){return u?(r=q[e++])?r.show():q[e]=d[b].apply(this,arguments):q.show()}:function(){return u?(c=s[b]||(s[b]=[]),q=d[b].apply(this,arguments),c.push(q),q.show()):s[b]=d[b].apply(this,arguments)}},hideAll:function(){c()},
getKeys:function(){return q}}}()};m.prototype.constructor=m;m.prototype.draw=function(a){a.componentPool=this._componentPool;return this.carpet.draw(a)};m.prototype.getLogicalSpace=function(a,b){a.componentPool=this._componentPool;return this.carpet.getLogicalSpace(a,b)};m.prototype.dispose=function(){this.carpet&&this.carpet.group&&this.carpet.group.remove();this._componentPool.emptyPool()};L.prototype.constructor=L;L.prototype.addCompositions=function(a,b){this.compositionsByCategory[b]=a};L.prototype.getBoundingBox=
function(a){var b=this.conf,p=a.refSide,c=a.alignment,q=a.refOffset,d=a.x,e=a.y,b=b.width=p*b.spreadFactor;!c||void 0!==d&&null!==d||(d=(q+p)/2-b/2);return{width:b,height:a.maxOtherSide,x:d,y:e}};L.prototype.getPostCalcDecisions=function(a,b){var p=this.conf.padding,c,q=0;for(c in b)q+=b[c].height||0;a.height=q+2*p.v};L.prototype.getLogicalSpace=function(a,b){var p=this._lSpace,c=this.conf.padding,q=this.compositionsByCategory,d,e,f;f=0;var g={},h,k=0;if(p&&!b)return p.isImpure=!0,p;p=this._lSpace=
e=this.getBoundingBox(a);if(I(p.x)||I(p.y)||I(p.height)||I(p.width))this.autoRecalculate=!0;p=t(e,{});p.height-=2*c.v;p.width-=2*c.h;p.x+=c.h;p.y+=c.v;for(h in q)d=q[h],c=t(p,{}),c.y+=f,f=p.height*d.conf.spreadFactor,c.height=f+k,f=d.getLogicalSpace(t(c,{}),a,b),k=c.height-f.height,g[h]=f,f=f.height;this.getPostCalcDecisions(e,g);return this._lSpace=e};L.prototype.setupDragging=function(){var a=this.group,b=0,p=0,c=0,q=0;a.css({cursor:"move"});a.drag(function(d,e){b=d;p=e;a.attr({transform:"t"+(c+
b)+","+(q+p)})},function(){c+=b;q+=p},function(){})};L.prototype.draw=function(a){var b=this.conf,p=this.compositionsByCategory,c=a.paper,q=a.parentGroup,d=a.componentPool,e,f,g=d.getChart().get("config","animationObj").duration,h,k=d.getKeys();this.getLogicalSpace(a,this.autoRecalculate);f=this._lSpace;h=d.getComponent(this._id,k.KEY_GROUP);this.group=q=h(this.groupName,q);q.attr({opacity:0});q.animate({opacity:1},g,"easeIn");h=d.getComponent(this._id,k.KEY_RECT);this.node=h(q).attr(f).css(b.style);
for(e in p)d=p[e],d.draw(b.captionAlignment,f,{colorRange:a.colorRange,numberFormatter:a.numberFormatter,paper:c,parentLayer:q,smartLabel:a.smartLabel,moveInstructions:this.moveInstructions[e],componentPool:a.componentPool});b.allowDrag&&this.setupDragging();return this.node};A.prototype=Object.create(L.prototype);A.prototype.constructor=A;A.prototype.getBoundingBox=function(a){var b=this.conf,p=a.refSide,c=a.alignment,q=a.refOffset,d=a.x,e=a.y,b=b.height=p*b.spreadFactor;!c||void 0!==e&&null!==e||
(e=(q+p)/2-b/2);return{width:a.maxOtherSide,height:b,x:d,y:e}};A.prototype.getPostCalcDecisions=function(a,b){var p=this.conf.padding,c=Number.NEGATIVE_INFINITY,d,e,f=this.moveInstructions;L.prototype.getPostCalcDecisions.apply(this,arguments);for(e in b)d=b[e].width,c=c<d?d:c;a.width=c+2*p.h;for(e in b)if(d=b[e].width,p=c-d)f[e]="t"+p/2+",0"};O.prototype.constructor=O;O.LEFT={x:function(a,b){return b.x+a.width/2+2}};O.RIGHT={x:function(a,b){return b.x+b.width-a.width/2-2}};O.CENTER={x:function(a,
b){return b.x+b.width/2}};O.prototype.getLogicalSpace=function(a,b,p){var c=this.conf.padding,d=this._lSpace,e=this.rawText,f=b.componentPool.getChart();if(d&&!p)return d.isImpure=!0,d;d=this._lSpace={bound:{height:0,width:0},node:{logicArea:void 0,smartText:void 0}};p=b.smartLabel;if(!e)return d.bound;b=t(a,{});b.height-=2*c.v;b.width-=2*c.h;b.x+=c.h;b.y+=c.v;p.useEllipsesOnOverflow(f.config.useEllipsesWhenOverflow);f=t(this.conf.style,{});w(f);p.setStyle(f);e=p.getSmartText(e,b.width,b.height);
b.height=e.height;b.width=e.width;a.height=e.height+2*c.v;a.width=e.width+2*c.h;d.node.smartText=e;d.node.logicArea=b;return d.bound=a};O.prototype.draw=function(){var a,b=this.conf.bound||{},p,c,d,e,f,g,h;3<=arguments.length?(d=arguments[0],e=arguments[1],f=arguments[2]):2<=arguments.length&&(d=arguments[0],f=arguments[1]);a=f.parentLayer;g=f.componentPool;h=g.getKeys();p=g.getComponent(this._id,h.KEY_GROUP);this.group=a=p("legend-caption",a);this.getLogicalSpace(e,f);p=this._lSpace;f=p.node;c=p.bound;
p=g.getComponent(this._id,h.KEY_RECT);this.bound=b=p(a).attr(c).css(b.style);d="string"===typeof d?O[d.toUpperCase()].x(f.smartText,e||f.logicArea):d;p=g.getComponent(this._id,h.KEY_TEXT);this.node=p(a).attr({text:f.smartText.text,x:d,y:f.logicArea.y+f.smartText.height/2}).css(this.conf.style);return{group:a,bound:b,node:this.node}};l.SC_STACK=["LEGEND_LABEL","LEGEND_AXIS","AXIS_VALUE"];l.DARW_STACK=["AXIS_VALUE","LEGEND_AXIS","LEGEND_LABEL"];l.prototype.constructor=l;l.prototype.addCompositions=
function(a,b){this.compositionsByCategory[b]=a};l.prototype.getCompositionPlotAreaFor=function(a){var b;b=t(a,{});return function(p,c){p=p||{};b.y+=p.height||0;b.height=a.height*c;return b}};l.prototype.getSpaceTaken=function(a){return a.height};l.prototype.updateEffectivePlotArea=function(a,b,p){var c=this.conf.padding;b.height=p;a.height=p+2*c.v};l.prototype.getLogicalSpace=function(a,b,p){var c=this._lSpace,d=this.conf.padding,e=this.compositionsByCategory,f,g,h,k=0,n,m;if(c&&!p)return c.isImpure=
!0,c;c=this._lSpace={bound:{height:0,width:0},node:{logicArea:void 0}};g=t(a,{});g.height-=2*d.v;g.width-=2*d.h;g.x+=d.h;g.y+=d.v;h=this.getCompositionPlotAreaFor(g);b.colorRange=this.colorRange;n=0;for(m=l.SC_STACK.length;n<m;n++)if(d=e[l.SC_STACK[n]])f=h(f,d.conf.spreadFactor),f=d.getLogicalSpace(t(f,{}),b,p),k+=this.getSpaceTaken(f);this.updateEffectivePlotArea(a,g,k);c.node.logicArea=g;return c.bound=a};l.prototype.draw=function(){var a,b;b=this.conf.bound.style||{};var c=this.compositionsByCategory,
d,q,e,f,g,h;3<=arguments.length?(q=arguments[1],f=arguments[2]):2<=arguments.length&&(f=arguments[1]);a=f.parentLayer;e=f.componentPool;g=e.getKeys();this.getLogicalSpace(q,f);q=this._lSpace;h=e.getComponent(this._id,g.KEY_GROUP);a=h("legend-body",a).attr({transform:"t0,0"});h=e.getComponent(this._id,g.KEY_RECT);this.bound=b=h(a).attr(q.bound).css(b);f.colorRange=this.colorRange;f.parentLayer=a;e=0;for(g=l.DARW_STACK.length;e<g;e++)(d=c[l.DARW_STACK[e]])&&d.draw(f);f.moveInstructions&&a.attr({transform:f.moveInstructions});
return{bound:b,group:a}};W.prototype=Object.create(l.prototype);W.prototype.constructor=W;W.prototype.getCompositionPlotAreaFor=function(a){var b;b=t(a,{});return function(c,d){c=c||{};b.x+=c.width||0;b.width=a.width*d;return b}};W.prototype.updateEffectivePlotArea=function(a,b,c){var d=this.conf.padding;b.width=c;a.width=c+2*d.h};W.prototype.getSpaceTaken=function(a){return a.width};M.prototype.constructor=M;M.prototype.getEffectivePlotArea=function(a){var b=this.conf.padding;a.height-=2*b.v;a.width-=
2*b.h;a.x+=b.h;a.y+=b.v;this.node=[];return a};M.prototype.getLogicalSpace=function(a,b,c){var d=this._lSpace,q=this.conf,e=q.padding,f,g,h=[],k,n,m,l,B,y=0,x,v,V;B=b.componentPool.getChart();var K=[];if(d&&!c)return d.isImpure=!0,d;d=b.colorRange;b=b.smartLabel;c=d.getCumulativeValueRatio();f=d.colorRange;d=this._lSpace={bound:{height:0,width:0},node:{logicArea:void 0,smartTexts:[]}};l=d.node.smartTexts;k=t(a,{});k=this.getEffectivePlotArea(k);b.useEllipsesOnOverflow(B.config.useEllipsesWhenOverflow);
q=t(q.style,{});w(q);b.setStyle(q);B=b.getSmartText("W");g=0;for(q=f.length;g<q;g++)(n=f[g].label)?(y++,K.push({oriIndex:g,label:n})):l[g]=void 0;q=K.length;if(0===q)return{height:0,width:0};n=m=1<q?(c[K[q-1].oriIndex]-c[K[0].oriIndex])/2*k.width/100:Math.max(c[K[0].oriIndex],100-c[K[0].oriIndex])/2*k.width/100;y=b.getSmartText(K[0].label,n,k.height);y.x=c[K[0].oriIndex]*k.width/100;g=y.x+y.width;h.push(y.height);l[K[0].oriIndex]=y;y=b.getSmartText(K[q-1].label,n,k.height);y.x=c[K[q-1].oriIndex]*
k.width/100;f=y.x-y.width;h.push(y.height);l[K[q-1].oriIndex]=y;v=g;for(g=1;g<q-1;g++)n=K[g].label,V=K[g].oriIndex,y=void 0,m=g+1===q-1?f:c[K[g+1].oriIndex]*k.width/100,x=c[K[g].oriIndex]*k.width/100,m=Math.min(x-v,m-x),m>2*B.width&&(y=b.getSmartText(n,m,k.height),y.x=c[V]*k.width/100,v=m,h.push(y.height)),l[K[g].oriIndex]=y;h=Math.max.apply(Math,h);k.height=h;a.height=h+2*e.v;d.node.logicArea=k;return d.bound=a};M.prototype.draw=function(){var a,b,c=this.conf;b=c.bound&&c.bound.style||{stroke:"none"};
var d,q,e,f,g,h={},k;2<=arguments.length?(q=arguments[0],f=arguments[1]):1<=arguments.length&&(f=arguments[0]);a=f.parentLayer;f.colorRange.getCumulativeValueRatio();d=f.componentPool;g=d.getKeys();this.getLogicalSpace(q,f);e=this._lSpace;q=e.node.logicArea;f=e.node.smartTexts;k=d.getComponent(this._id,g.KEY_GROUP);a=k("legend-labels",a);k=d.getComponent(this._id,g.KEY_RECT);this.bound=b=k(a).attr(e.bound).css(b);a.transform("R0");k=d.getComponent(this._id,g.KEY_TEXT,!0);g=0;for(e=f.length;g<e;g++)if(d=
f[g])h.y=q.y+d.height/2,h.x=g===e-1?q.x+d.x-d.width/2:g?q.x+d.x:q.x+d.x+d.width/2,this.node.push(k(a).attr({text:d.text}).attr(h).css(c.style).transform("R0"));return{group:a,bound:b,node:this.node}};Y.prototype=Object.create(M.prototype);Y.prototype.constructor=Y;Y.prototype.getLogicalSpace=function(a){var b;if(a){b=a;var c=b.height;b.height=b.width;b.width=c}b=M.prototype.getLogicalSpace.apply(this,arguments);return{height:b.width,width:b.height}};Y.prototype.draw=function(){var a,b,c,d,q;c=M.prototype.draw.apply(this,
arguments);a=c.bound;b=c.group;a=a.getBBox();c=c.node;b.transform("R90,"+(a.x+a.height/2)+","+(a.y+a.height/2));b=0;for(a=c.length;b<a;b++)d=c[b],q=d.getBBox(),d.transform("R180,"+(q.x+q.width/2)+","+(q.y+q.height/2))};S.prototype=Object.create(M.prototype);S.prototype.constructor=S;S.prototype.getLogicalSpace=function(a,b,c){var d=this._lSpace,q=this.conf,e=q.padding,f=b.componentPool.getChart(),g,h,k,n,m,l,B=[],y,x,v,V;if(d&&!c)return d.isImpure=!0,d;d=b.colorRange;b=b.smartLabel;c=d.colorRange;
k=d.getCumulativeValueRatio();d=this._lSpace={bound:{height:0,width:0},node:{logicArea:void 0,smartTexts:[]}};V=d.node.smartTexts;x=t(a,{});x.height-=2*e.v;x.width-=2*e.h;x.x+=e.h;x.y+=e.v;b.useEllipsesOnOverflow(f.config.useEllipsesWhenOverflow);q=t(q.style,{});w(q);b.setStyle(q);f=b.getSmartText("W");q=c.length;l=(k[q-1]-k[0])/2*x.width/100;g=c[0].displayValue;g=b.getSmartText("string"!==typeof g&&void 0!==g&&g.toString()||g,l,x.height);g.x=k[0]*x.width/100;h=g.x+g.width;B.push(g.height);V[0]=g;
g=b.getSmartText(c[q-1].displayValue,l,x.height);g.x=k[q-1]*x.width/100;l=g.x-g.width;B.push(g.height);V[q-1]=g;y=h;for(h=1;h<q-1;h++)g=void 0,v=c[h].displayValue,n=h+1===q-1?l:k[h+1]*x.width/100,m=k[h]*x.width/100,n=Math.min(m-y,n-m),n>1.5*f.width&&(g=b.getSmartText(v,2*n,x.height),g.x=k[h]*x.width/100,y=n,B.push(g.height)),V[h]=g;B=Math.max.apply(Math,B);x.height=B;a.height=B+2*e.v;d.node.logicArea=x;return d.bound=a};S.prototype.draw=function(){var a=this.conf,b=a.bound&&a.bound.style||{stroke:"none"},
c,d={},q,e,f,g,h,k,n;2<=arguments.length?(f=arguments[0],h=arguments[1]):1<=arguments.length&&(h=arguments[0]);q=h.parentLayer;k=h.colorRange.getCumulativeValueRatio();e=h.componentPool;c=e.getKeys();this.getLogicalSpace(f,h);g=this._lSpace;f=g.node.logicArea;h=g.node.smartTexts;n=e.getComponent(this._id,c.KEY_GROUP);q=n("legend-values",q);n=e.getComponent(this._id,c.KEY_RECT);this.bound=b=n(q).attr(g.bound).css(b);n=e.getComponent(this._id,c.KEY_TEXT,!0);c=0;for(k=k.length;c<k;c++)if(e=h[c])d.y=
f.y+e.height/2,d.x=c===k-1?f.x+e.x-e.width/2:c?f.x+e.x:f.x+e.x+e.width/2,n(q).attr({text:e.text}).attr(d).css(a.style);return{group:q,bound:b}};Z.prototype=Object.create(S.prototype);Z.prototype.constructor=Z;Z.prototype.getLogicalSpace=function(a,b,c){var d=this._lSpace,e=this.conf,f=e.padding,g=b.componentPool.getChart(),h,k,n,m,l,D,B=[],y,x,v,V;if(d&&!c)return d.isImpure=!0,d;d=b.colorRange;b=b.smartLabel;c=d.colorRange;k=d.getCumulativeValueRatio();d=this._lSpace={bound:{height:0,width:0},node:{logicArea:void 0,
smartTexts:[]}};V=d.node.smartTexts;l=t(a,{});l.height-=2*f.v;l.width-=2*f.h;l.x+=f.h;l.y+=f.v;b.useEllipsesOnOverflow(g.config.useEllipsesWhenOverflow);e=t(e.style,{});w(e);b.setStyle(e);v=b.getSmartText("W");g=c.length;D=(k[g-1]-k[0])/2*l.height/100;e=b.getSmartText(c[0].displayValue,l.width,D);e.y=k[0]*l.height/100;h=e.y+e.width;B.push(e.width);V[0]=e;e=b.getSmartText(c[g-1].displayValue,l.width,D);e.y=k[g-1]*l.height/100;D=e.y-e.height;B.push(e.width);V[g-1]=e;y=h;for(h=1;h<g-1;h++)e=void 0,x=
c[h].displayValue,n=h+1===g-1?D:k[h+1]*l.height/100,m=k[h]*l.height/100,n=Math.min(m-y,n-m),n>2*v.height&&(e=b.getSmartText(x,l.width,2*n),e.y=k[h]*l.height/100,y=n,B.push(e.width)),V[h]=e;B=Math.max.apply(Math,B);l.width=B;a.width=B+2*f.h;d.node.logicArea=l;return d.bound=a};Z.prototype.draw=function(){var a,b,c=this.conf;b=c.bound&&c.bound.style||{stroke:"none"};var d,e,f,g,h,k,n={},l;2<=arguments.length?(d=arguments[0],f=arguments[1]):1<=arguments.length&&(f=arguments[0]);a=f.parentLayer;g=f.colorRange.getCumulativeValueRatio();
h=f.componentPool;k=h.getKeys();this.getLogicalSpace(d,f);e=this._lSpace;d=e.node.logicArea;f=e.node.smartTexts;l=h.getComponent(this._id,k.KEY_GROUP);a=l("legend-values",a);l=h.getComponent(this._id,k.KEY_RECT);this.bound=b=l(a).attr(e.bound).css(b);l=h.getComponent(this._id,k.KEY_TEXT,!0);h=0;for(k=g.length;h<k;h++)if(g=f[h])n.x=d.x+g.width/2,n.y=h===k-1?d.y+g.y-g.height/2:h?d.y+g.y:d.y+g.y+g.height/2,l(a).attr({text:g.text}).attr(n).css(c.style);return{group:a,bound:b}};N.prototype.constructor=
N;N.prototype.addCompositions=function(a,b){this.compositionsByCategory[b]=a};N.prototype.getLogicalSpace=function(a,b,c){b=this._lSpace;var d=this.conf,e=d.padding,g,f;f=d.legendAxisHeight;var h=this.compositionsByCategory,k;k=0;if(b&&!c)return b.isImpure=!0,b;b=this._lSpace={bound:{height:0,width:0},node:{logicArea:void 0}};c=t(a,{});c.height-=2*e.v;c.width-=2*e.h;c.x+=e.h;c.y+=e.v;d=f/2+d.line.offset;g=f/2;if(h=h.RANGE)k=h.sliders[!1],k=k.conf.outerCircle.rFactor*f,g+=k=Math.max(k/2-f/2,0);c.y+=
k;c.height=f=g+d+k;a.height=f+2*e.v;b.node.logicArea=c;return b.bound=a};N.prototype.getDrawableAxisArea=function(a){var b=this.conf;return{x:a.x,y:a.y,width:a.width,height:b.legendAxisHeight,r:b.legendAxisHeight/2}};N.prototype.preDrawingRangeParam=function(a){return{y:a.y+a.height/2,calculationBase:a.height,rangeStart:a.x,rangeEnd:a.x+a.width,prop:"y"}};N.prototype.getScaleMarkerPathStr=function(a,b){var c=t(a,{}),d=this.conf.line,e,f,g,h,k="";c.x+=c.r;c.width-=2*c.r;h=c.y+c.height;e=0;for(f=b.length;e<
f;e++)g=b[e],g=c.x+g*c.width/100,k+="M"+g+","+(h-d.grooveLength)+"L"+g+","+(h+d.offset);c=""+("M"+c.x+","+(h+d.offset)+"L"+(c.x+c.width)+","+(h+d.offset));return k+c};N.prototype.getColorGradient=function(a){return{axis:a.getBoxFill(),shadow:U({FCcolor:{alpha:"25,0,0",angle:90,color:"000000,FFFFFF,FFFFFF",ratio:"0,30,40"}})}};N.prototype.draw=function(){var a,b=this.conf,c=b.line,d=(b.bound||{}).style||{},e,g,f=this.compositionsByCategory,h,k,n,l,m,D;2<=arguments.length?(e=arguments[0],m=arguments[1]):
1<=arguments.length&&(m=arguments[0]);a=m.parentLayer;h=m.colorRange;k=h.getCumulativeValueRatio();D=m.componentPool;n=D.getKeys();this.getLogicalSpace(e,m);l=this._lSpace;e=D.getComponent(this._id,n.KEY_GROUP);a=e("legend-axis",a);e=D.getComponent(this._id,n.KEY_RECT,!0);this.bound=e(a).attr(l.bound).css(d);d=this.getDrawableAxisArea(l.node.logicArea);h=this.getColorGradient(h);b.style.fill=h.axis;b.shadow.style.fill=h.shadow;this.node=e(a).attr(d).css(b.style);this.shadow=e(a).attr(d).css(b.shadow.style);
b=this.getScaleMarkerPathStr(d,k);e=D.getComponent(this._id,n.KEY_PATH);e("M0,0",a).attr({path:b}).css(c.style);for(g in f)switch(c=f[g],g){case "RANGE":n=this.preDrawingRangeParam(d),m[n.prop]=n[n.prop],m.key=n.prop,m.rCalcBase=n.calculationBase,m.parentLayer=a,c.draw(n.rangeStart,n.rangeEnd,m)}};T.prototype=Object.create(N.prototype);T.prototype.constructor=T;T.prototype.getLogicalSpace=function(a,b,c){b=this._lSpace;var d=this.conf,e=d.padding,g,f;f=d.legendAxisHeight;var h=this.compositionsByCategory,
k;k=0;if(b&&!c)return b.isImpure=!0,b;b=this._lSpace={bound:{height:0,width:0},node:{logicArea:void 0}};c=t(a,{});c.height-=2*e.v;c.width-=2*e.h;c.x+=e.h;c.y+=e.v;d=f/2+d.line.offset;g=f/2;if(h=h.RANGE)k=h.sliders[!1],k=k.conf.outerCircle.rFactor*f,g+=k=Math.max(k/2-f/2,0);c.x+=k;c.width=f=g+d+k;a.width=f+2*e.v;b.node.logicArea=c;return b.bound=a};T.prototype.getDrawableAxisArea=function(a){var b=this.conf;return{x:a.x,y:a.y,width:b.legendAxisHeight,height:a.height,r:b.legendAxisHeight/2}};T.prototype.getScaleMarkerPathStr=
function(a,b){var c=t(a,{}),d=this.conf.line,e,f,g,h,k="";c.y+=c.r;c.height-=2*c.r;h=c.x+c.width;e=0;for(g=b.length;e<g;e++)f=b[e],f=c.y+f*c.height/100,k+="M"+(h-d.grooveLength)+","+f+"L"+(h+d.offset)+","+f;c=""+("M"+(h+d.offset)+","+c.y+"L"+(h+d.offset)+","+(c.y+c.height));return k+c};T.prototype.getColorGradient=function(a){return{axis:a.getBoxFill(!0),shadow:U({FCcolor:{alpha:"25,0,0",angle:360,color:"000000,FFFFFF,FFFFFF",ratio:"0,30,40"}})}};T.prototype.preDrawingRangeParam=function(a){return{x:a.x+
a.width/2,calculationBase:a.width,rangeStart:a.y,rangeEnd:a.y+a.height,prop:"x"}};C.prototype.constructor=C;C.prototype.initRange=function(a,b){this.extremes[+a.sliderIndex]=b};C.prototype.updateRange=function(a,b){var c=a.sliderIndex;this.sliders[!c].updateSwingRange(c,b)};C.prototype.reset=function(){var a={};a.conf=this.conf;a.sliderGroup=this;this.sliders[!1]=new P(!1,a,this._id+"_0");this.sliders[!0]=new P(!0,a,this._id+"_1");this.draw.apply(this,this._drawParams)};C.prototype.clearListeners=
function(){this.callbacks.length=0};C.prototype.draw=function(a,b,c){var d=this.sliders,e=d[!1],d=d[!0],f=c.colorRange,g=f.colorRange,h=this._fcChart=c.componentPool.getChart();this.getValueFormPixel=function(a,b,c,d){var e=(b-a)/(d-c);this.getValueFormPixel=function(b){return a+e*b}};this.updateWhenInMove=function(a,b){this.updateWhenInMove=function(c,d){var e=this.extremes,e=this.getValueFormPixel(c.sliderIndex?e[1]-e[0]+d:d);return e=b?parseFloat(e).toFixed(2)+"%":a.legendValue(e)}};this._drawParams=
[a,b,c];this.updateWhenInMove(h.components.numberFormatter,f.mapByPercent);a=e.draw(a,g[0].displayValue,c[c.key],c);a=d.draw(b,g[g.length-1].displayValue,c[c.key],c);e.swing=this.extremes.slice(0);d.swing=this.extremes.slice(0);this.getValueFormPixel(g[0].value,g[g.length-1].value,this.extremes[0],this.extremes[1]);return a};C.prototype.registerListener=function(a,b,c){this.callbacks.push({fn:a,context:b,params:c||[]})};C.prototype.updateWhenInRest=function(a,b){var c=this.sliders,d=this.extremes,
e=a.sliderIndex,g,f=this.callbacks,h,k;e?(g=c[!e].currPos,c=d[1]-d[0]+b):(g=b,c=d[1]-d[0]+c[!e].currPos);d=0;for(e=f.length;d<e;d++)h=f[d],k=h.params.slice(0),k.unshift(this.getValueFormPixel(c)),k.unshift(this.getValueFormPixel(g)),h.fn.apply(h.context,k)};C.prototype.dragStarted=function(a){var b=this.sliders,c=this.extremes,d=a.conf,e=this._fcChart;E.raiseEvent("legendpointerdragstart",{pointerIndex:+a.sliderIndex,pointers:[{value:this.getValueFormPixel(b[!1].currPos)},{value:this.getValueFormPixel(c[1]-
c[0]+b[!0].currPos)}],legendPointerHeight:d.outerRadius,legendPointerWidth:d.innerRadius,outerRadius:d.outerRadius,innerRadius:d.innerRadius},e.chartInstance,[e.id])};C.prototype.dragCompleted=function(a,b,c){var d=this.sliders,e=this.extremes,g=a.conf,f=this.getValueFormPixel(d[!1].currPos),d=this.getValueFormPixel(e[1]-e[0]+d[!0].currPos),h=this._fcChart,k;a.sliderIndex?(k=f,c=this.getValueFormPixel(e[1]-e[0]+c)):(k=this.getValueFormPixel(c),c=d);b&&E.raiseEvent("legendrangeupdated",{previousMinValue:f,
previousMaxValue:d,minValue:k,maxValue:c},h.chartInstance,[h.id]);E.raiseEvent("legendpointerdragstop",{pointerIndex:+a.sliderIndex,pointers:[{value:f},{value:d}],legendPointerHeight:g.outerRadius,legendPointerWidth:g.innerRadius,outerRadius:g.outerRadius,innerRadius:g.innerRadius},h.chartInstance,[h.id])};P.prototype.constructor=P;P.prototype.updateSwingRange=function(a,b){this.swing[+a]=b};P.prototype.draw=function(a,b,c,d){var g=d.parentLayer,f=this.conf,h=f.outerCircle,k=f.innerCircle,n=Math.ceil(h.rFactor*
d.rCalcBase/2),l=Math.ceil(k.rFactor*d.rCalcBase/2),m=n-l,t=this.rangeGroup,v=this.sliderIndex,B,y,x=d.componentPool,w=x.getKeys();f.outerRadius=n;f.innerRadius=l;this._scaleVal=b;k.style["stroke-width"]=m;m=Math.ceil(h.style["stroke-width"]/2);l+=m;y=x.getComponent(this._id,w.KEY_GROUP);g=this.node=y("fc-gl-slider",g).attr({cursor:"pointer",transform:"t0,0"});"x"===d.key?a=B=a+(v?-l:+l):(B=c,a=c=a+(v?-l:+l));t.initRange(this,a);y=x.getComponent(this._id,w.KEY_CIRCLE,!0);y(g).attr({cx:c,cy:B,r:n}).css(h.style);
y(g).attr({cx:c,cy:B,r:l}).css(k.style);b=this.tracker=y(g).attr({cx:c,cy:B,r:n+5,ishot:!0,fill:e,stroke:0,cursor:"pointer"}).trackTooltip(f.showTooltip?!0:!1).tooltip(b,null,null,!0);this._dragAPI=d=this.getDragAPI("x"===d.key);b.undrag();b.drag(d.dragging,d.dragStart,d.dragEnd);return{translateAscending:n+m}};P.prototype.getDragAPI=function(a){var b=this,c=b.node,d=b.sliderIndex,e=b.rangeGroup,g,f,h,k=b.conf.innerRadius,n;return{dragging:function(l,m,t,v,y){var x;y.stopPropagation();y.preventDefault();
x=a?m:l;d?(l=g[0]-g[1]+k,m=0):(l=0,m=g[1]-g[0]-k);if(!(b.currPos+x<l||b.currPos+x>m))return c.attr({transform:a?"t0,"+(b.currPos+x):"t"+(b.currPos+x)+",0"}),f=x,h&&clearTimeout(h),h=setTimeout(function(){e.updateWhenInRest(b,b.currPos+x)},100),b.tracker.tooltip(e.updateWhenInMove(b,b.currPos+x),null,null,!0),n=!0},dragStart:function(d,f,h){h.stopPropagation();h.preventDefault();c.attr({transform:a?"t0,"+b.currPos:"t"+b.currPos+",0"});g=g||b.swing;n=!1;e.dragStarted(b)},dragEnd:function(){var a;e.dragCompleted(b,
n,b.currPos+f);n&&(h&&clearTimeout(h),h=setTimeout(function(){e.updateWhenInRest(b,b.currPos)},100),b.currPos+=f,a=g[+d]+b.currPos,e.updateRange(b,a))}}};Q.prototype.constructor=Q;Q.prototype.getValueRatio=function(){var a=this.colorRange,b,c,d=a.length,e=this.valueRatio,g=a[0].value,f=a[d-1].value-g,h=0;if(e)return e;e=this.valueRatio=[];for(c=0;c<d;c++)b=a[c],b=(b.value-g)/f,e.push(100*(b-h)),h=b;return e};Q.prototype.getCumulativeValueRatio=function(){var a=this.colorRange,b,c,d=a.length,e=a[0].value,
g=a[d-1].value,f=[];for(c=0;c<d;c++)b=a[c],f.push((b.value-e)/(g-e)*100);return f};Q.prototype.getBoxFill=function(a){var b=this.colorRange,c,d=b.length,e=[],g;g=a?90:0;for(c=0;c<d;c++)a=b[c],e.push(a.code);b={FCcolor:{alpha:"100,100,100",angle:g,color:e.join(","),ratio:this.getValueRatio().join(",")}};return U(b)};Q.prototype.getColorByValue=function(c){var d=this.values,e=this.colorRange,g,f,h,k;if(void 0!==c&&null!==c){f=0;for(g=d.length;f<g;f++)if(c===d[f]){k=e[f].code;break}else if(!f&&c<d[f]){h=
!0;break}else if(f===g-1&&c>d[f]){h=!0;break}else if(c>d[f]&&c<d[f+1]){d=e[f];g=e[f+1];e=d.value;f=a(d.code);d=g.value;g=a(g.code);k=k=void 0;k=d-e;k=[Math.round(f[0]+(g[0]-f[0])/k*(c-e)),Math.round(f[1]+(g[1]-f[1])/k*(c-e)),Math.round(f[2]+(g[2]-f[2])/k*(c-e))];k=b(k);break}if(!h)return k}};$.prototype=Object.create(m.prototype);$.prototype.constructor=$;FusionCharts.register("component",["gradientLegend","gradientLegend",{pIndex:1,enabled:!1,init:function(a){function b(e){c.data=a.chart.jsonData.colorrange;
(k=c.nData=g.legacyDataParser(c.data,e))?(c.drawOptions={smartLabel:d.linkedItems.smartLabel,colorRange:c.colorRange=f=new Q(k,e,n),maxOtherSide:e.maxOtherSide},c._dontPlot=!1,f&&f._preparationGoneWrong&&(c._dontPlot=!0),c._recalculateLogicalSpace=!0,c._configure()):c._dontPlot=!0}var c=this,d=a.chart,e,f,k,n;g.init(a);n=c._chart=a.chart;c._cpool=h(n);if(!(e=a.dataExtremes))return b;b(e)},_configure:function(){var a=this._chart,b=a.jsonData.chart,c=this.conf={},d=b.outcnvbasefont,e=b.outcnvbasefontsize,
f=b.outcnvbasefontcolor,a=a.config.dataLabelStyle,g,h,k,n,l,m,t;c.caption=J(b.legendcaption);c.legendPosition=J(b.legendposition,"bottom").toLowerCase();c.showLegend=v(b.showlegend,1);c.interactiveLegend=v(b.interactivelegend,1);c.showLegendLabels=v(b.showlegendlabels,1);g=b.legenditemfontcolor||f;h=b.legenditemfont||d;k=b.legenditemfontsize||e;n=v(b.legenditemfontbold,0);f=b.legendcaptionfontcolor||f;d=b.legendcaptionfont||d;e=b.legendcaptionfontsize||e;l=v(b.legendcaptionfontbold,1);t=(m=b.legendaxisbordercolor?
da(ca(b.legendaxisbordercolor)):void 0)?v(b.legendaxisborderalpha,100)/100:void 0;c.axisTextItemConf={style:{fill:g?X(J(g)):a.color,fontFamily:h?J(h):a.fontFamily,fontSize:k?v(k):a.fontSize.match(/\d+/)[0],fontWeight:n?"bold":a.fontWeight}};c.legendCaptionConf={style:{fill:f?X(J(f)):a.color,fontFamily:d?J(d):a.fontFamily,fontSize:e?v(e):a.fontSize.match(/\d+/)[0],fontWeight:l?"bold":a.fontWeight,fontStyle:"normal"}};c.legendAxisConf={legendAxisHeight:11,style:{stroke:m,"stroke-opacity":t},line:{style:{stroke:X(J(b.legendscalelinecolor,
"FFF8E9"),v(b.legendscalelinealpha,100)),"stroke-width":v(b.legendscalelinethickness)}}};c.sliderGroupConf={showTooltip:v(b.showtooltip,1),outerCircle:{rFactor:v(b.sliderdiameterfactor),style:{stroke:X(J(b.legendpointerbordercolor,"757575"),v(b.legendpointerborderalpha,100))}},innerCircle:{rFactor:v(b.sliderholediameterfactor),style:{stroke:X(J(b.legendpointercolor,"FFFFFF"),v(b.legendpointeralpha,100))}}};c.legendCarpetConf={spreadFactor:v(b.legendspreadfactor),allowDrag:!!v(b.legendallowdrag,0),
captionAlignment:J(b.legendcaptionalignment,"center"),style:{fill:X(J(b.legendbgcolor,"e4d9c1"),v(b.legendbgalpha,100)),stroke:X(J(b.legendbordercolor,"c4b89d"),v(b.legendborderalpha,100)),"stroke-width":v(b.legendborderthickness,1)}}},postConfigureInit:function(){var a=this.conf,b,c,d,e,f,h,k;this.elem={};a.caption&&(f=t(g.getDefaultConf("legendCaptionConf"),a.legendCaptionConf),b=new O(a.caption,f));a.interactiveLegend&&(f=t(g.getDefaultConf("sliderGroupConf"),a.sliderGroupConf),this.elem.sGroup=
e=new C(f),this.listeners&&0<this.listeners.length&&e.registerListener.apply(e,this.listeners));f=t(g.getDefaultConf("legendCarpetConf"),a.legendCarpetConf);"bottom"===a.legendPosition?(this.drawOptions.refSideKey="canvasWidth",this.drawOptions.refOffsetKey="canvasLeft",c=new L(f),h=new l(this.drawOptions.colorRange,g.getDefaultConf("legendBodyConf")),d=new N(t(g.getDefaultConf("legendAxisConf"),a.legendAxisConf)),f=t(g.getDefaultConf("axisTextItemConf"),a.axisTextItemConf),a.showLegendLabels&&(k=
new M(f)),a=new S(f)):(this.drawOptions.refSideKey="canvasHeight",this.drawOptions.refOffsetKey="canvasTop",c=new A(f),h=new W(this.drawOptions.colorRange,g.getDefaultConf("legendBodyConf")),d=new T(t(g.getDefaultConf("legendAxisConf"),a.legendAxisConf)),f=t(g.getDefaultConf("axisTextItemConf"),a.axisTextItemConf),a.showLegendLabels&&(k=new Y(f)),a=new Z(f));e&&d.addCompositions(e,"RANGE");k&&h.addCompositions(k,"LEGEND_LABEL");h.addCompositions(d,"LEGEND_AXIS");h.addCompositions(a,"AXIS_VALUE");
b&&c.addCompositions(b,"CAPTION");c.addCompositions(h,"LEGEND_BODY");this.elem.gl=new $(c,this._cpool)},notifyWhenUpdate:function(a,b,c){var d;(d=this.elem&&this.elem.sGroup)?d.registerListener(a,b,c):this.listeners=[a,b,c]},dispose:function(){this.elem&&this.elem.gl&&this.elem.gl.dispose();this.elem={}},getLogicalSpace:function(a){var b=this.conf,c={height:0,width:0},d=this.drawOptions,e=this._chart;if(!this._recalculateLogicalSpace)return b=d.refSideKey,d=d.refOffsetKey,this.drawOptions.refSide=
e.config[b],this.drawOptions.refOffset=e.config[d],(this._logicalArea=this.elem.gl.getLogicalSpace(this.drawOptions,!0))||c;if(this._dontPlot)return c;this._recalculateLogicalSpace=!1;this.postConfigureInit();if(!b.showLegend)return c;b=d.refSideKey;d=d.refOffsetKey;this.drawOptions.refSide=e.config[b];this.drawOptions.refOffset=e.config[d];this.drawOptions.maxOtherSide=a||this.drawOptions.maxOtherSide;return this.elem.gl&&(this._logicalArea=this.elem.gl.getLogicalSpace(this.drawOptions,!0))},resetLegend:function(){var a;
(a=this.elem&&this.elem.sGroup)&&a.reset()},clearListeners:function(){var a;(a=this.elem&&this.elem.sGroup)&&a.clearListeners()},draw:function(a,b,c){var d=this.conf;this._dontPlot||(this._cpool.init(c.paper),d.showLegend?(this.drawOptions.paper=c.paper,this.drawOptions.parentGroup=c.parentGroup,this.drawOptions.x=a,this.drawOptions.y=b,this.drawOptions.maxOtherSide=this.drawOptions.maxOtherSide||c.maxOtherSide,a=this.elem.gl.draw(this.drawOptions),a=a.getBBox(),d.xPos=a.x,d.yPos=a.y,d.height=a.height,
d.width=a.width,this.enabled=!0):this.enabled=!1)}}])}]);
FusionCharts.register("module",["private","modules.renderer.js-maps",function(){var t=this,R=t.window,w=t.hcLib,I=w.chartAPI,m=w.pluck,L=w.imprint,A=w.extend2,O=w.parseTooltext,l=w.pluckNumber,W=w.graphics.getLightColor,M=w.dropHash,Y=w.HASHSTRING,S=w.parseUnsafeString,Z=w.getDashStyle,N=A(w.defaultPaletteOptions,{foregroundcolor:"333333",foregroundalpha:"100",foregrounddarkcolor:"111111",foregrounddarkalpha:"100",foregroundlightcolor:"666666",foregroundlightalpha:"100",backgroundlightcolor:"FFFFFF",
backgroundlightalpha:"100",backgroundlightangle:90,backgroundlightratio:"",backgroundcolor:"FFFFCC",backgroundalpha:"100",backgrounddarkcolor:"ffcc66",backgrounddarkalpha:"100",backgrounddarkangle:270,backgrounddarkratio:"",shadow:1}),T=w.setLineHeight,C=w.graphics.convertColor,P=/msie/i.test(R.navigator.userAgent)&&!R.opera,Q=w.hasSVG,$=R.Math,E=$.min,z=$.max,R=!/fusioncharts\.com$/i.test(R.location.hostname),v=w.toRaphaelColor,J=function(b,a){var c;b||(b={});for(c in a)b[c]=a[c];return b},U=function(b,
a){var c=a?J(b.FCcolor,a):{FCcolor:b};c.toString=v;return c},aa=function(b,a){var c,d;this.index=a;for(d in b)c=N[b[d]],this[d]=c instanceof Array?c[a]:c},ca={right:function(b,a){return a},left:function(b,a){return b-a},center:function(b,a){return 2*E(a,b-a)}},da={top:function(b,a){return a},middle:function(b,a){return 2*E(a,b-a)},bottom:function(b,a){return b-a}},X=function(b,a){var c=b&&b.length||!1,d=a||"id",e={},g;if(!b)return b;for(;c--;)g=b[c],void 0!==g[d]&&(e[g[d].toLowerCase()]=g);return e};
J(w.eventList,{entityrollover:"FC_Event",entityrollout:"FC_Event"});I("geo",{name:"geo",friendlyName:"Map",revision:1,creditLabel:R,hasCanvas:!0,standaloneInit:!1,defaultDatasetType:"maps",baseWidth:400,baseHeight:300,baseScaleFactor:1,defaultSeriesType:"geo",fireGroupEvent:!0,legendposition:"right",hasGradientLegend:!0,isMap:!0,entities:{},init:function(b,a,c,d){var e,g;g=a.chart=a.chart||a.graph||a.map||{};this.jsonData=a;e=this.components=this.components||(this.components={});e.mapAnnotations=
e.mapAnnotations||(e.mapAnnotations=new w.Annotations);this.components.colorPalette=new aa(this.colorPaletteMap,(0<g.palette&&6>g.palette?g.palette:l(this.paletteIndex,1))-1);g=FusionCharts.register("component",["caption","MapCaption"]);e.caption||(e.caption=new g);I.mscartesian.init.call(this,b,a,c,d)},configure:function(){var b;b=this.jsonData;var a=b.chart||b.map,c=b.markers,d=new aa(this.colorPaletteMap,(0<a.palette&&6>a.palette?a.palette:l(this.paletteIndex,1))-1),e,g,k,f,h=m(a.entitybordercolor,
a.bordercolor,d.plotbordercolor),n=m(a.entityfillcolor,a.fillcolor,d.plotfillcolor),u=m(a.entityfillalpha,a.fillalpha,d.plotfillalpha),s=m(a.entityfillratio,a.fillratio,d.plotfillratio),p=m(a.entityfillangle,a.fillangle,d.plotfillangle),r=m(a.nullentityfillcolor,a.nullentitycolor,n),q=l(a.usevaluesformarkers,b.markers&&b.markers.items&&b.markers.items.length,!(b.markers&&b.markers.application&&b.markers.application.length&&b.markers.definition&&b.markers.definition.length));this.base.base.configure.call(this);
b=this.config;b.origMarginTop=l(a.charttopmargin,a.maptopmargin,11);b.origMarginLeft=l(a.chartleftmargin,a.mapleftmargin,11);b.origMarginBottom=l(a.chartbottommargin,a.mapbottommargin,11);b.origMarginRight=l(a.chartrightmargin,a.maprightmargin,11);f=b.style;e=f.inCancolor;g=f.inCanfontFamily;k=f.inCanfontSize;b.entityOpts={baseScaleFactor:this.baseScaleFactor,dataLabels:{style:{fontFamily:g,fontSize:k,lineHeight:f.inCanLineHeight,color:f.inCancolor}},fillColor:n,fillAlpha:u,fillRatio:s,fillAngle:p,
borderColor:h,borderAlpha:m(a.entityborderalpha,a.borderalpha,this.borderAlpha,"100"),borderThickness:l(a.showentityborder,a.showborder,1)?l(a.entityborderthickness,a.borderthickness,1):0,scaleBorder:l(a.scaleentityborder,a.scaleborder,0),hoverFillColor:m(a.entityfillhovercolor,a.hoverfillcolor,a.hovercolor,d.plothoverfillcolor),hoverFillAlpha:m(a.entityfillhoveralpha,a.hoverfillalpha,a.hoveralpha,d.plothoverfillalpha),hoverFillRatio:m(a.entityfillhoverratio,a.hoverfillratio,a.hoverratio,d.plothoverfillratio),
hoverFillAngle:m(a.entityfillhoverangle,a.hoverfillangle,a.hoverangle,d.plothoverfillangle),hoverBorderThickness:m(a.entityborderhoverthickness,a.hoverborderthickness),hoverBorderColor:m(a.entityborderhovercolor,d.plotbordercolor),hoverBorderAlpha:m(a.entityborderhoveralpha,d.plotborderalpha),nullEntityColor:r,nullEntityAlpha:m(a.nullentityfillalpha,a.nullentityalpha,u),nullEntityRatio:m(a.nullentityfillratio,a.nullentityratio,s),nullEntityAngle:m(a.nullentityfillangle,a.nullentityangle,p),connectorColor:m(a.labelconnectorcolor,
a.connectorcolor,e),connectorAlpha:m(a.labelconnectoralpha,a.connectoralpha,"100"),connectorThickness:l(a.labelconnectorthickness,a.borderthickness,1),showHoverEffect:l(a.showentityhovereffect,a.usehovercolor,a.showhovereffect,1),hoverOnNull:l(a.hoveronnull,a.entityhoveronnull,1),labelPadding:l(a.labelpadding,5),showLabels:l(a.showlabels,1),labelsOnTop:l(a.entitylabelsontop,1),includeNameInLabels:l(a.includenameinlabels,1),includeValueInLabels:l(a.includevalueinlabels,0),useSNameInTooltip:l(a.usesnameintooltip,
0),useShortName:l(a.usesnameinlabels,1),labelSepChar:m(a.labelsepchar,", "),showTooltip:l(a.showentitytooltip,a.showtooltip,1),tooltipSepChar:m(a.tooltipsepchar,", "),tooltext:a.entitytooltext,hideNullEntities:l(a.hidenullentities,0),showHiddenEntityBorder:l(a.showhiddenentityborder,1),showNullEntityBorder:l(a.shownullentityborder,1),hiddenEntityColor:m(a.hiddenentitycolor,a.hiddenentityfillcolor,a.hiddenentityalpha||a.hiddenentityfillalpha?r:"ffffff"),hiddenEntityAlpha:m(a.hiddenentityalpha,a.hiddenentityfillalpha,
.001),shadow:l(a.showshadow,this.defaultPlotShadow,d.shadow)};b.markerOpts={dataLabels:{style:{fontFamily:m(a.markerfont,g),fontSize:l(a.markerfontsize,parseInt(k,10)),fontColor:m(a.markerfontcolor,e)}},showTooltip:l(a.showmarkertooltip,a.showtooltip,1),showLabels:l(a.showmarkerlabels,a.showlabels,1),showHoverEffect:l(a.showmarkerhovereffect,1),labelPadding:m(a.markerlabelpadding,"5"),labelWrapWidth:l(a.markerlabelwrapwidth,0),labelWrapHeight:l(a.markerlabelwrapheight,0),fillColor:m(a.markerfillcolor,
a.markerbgcolor,d.markerfillcolor),fillAlpha:m(a.markerfillalpha,d.markerfillalpha),fillAngle:m(a.markerfillangle,d.markerfillangle),fillRatio:m(a.markerfillratio,d.markerfillratio),fillPattern:m(a.markerfillpattern,d.markerbgpattern),hoverFillColor:a.markerfillhovercolor,hoverFillAlpha:a.markerfillhoveralpha,hoverFillRatio:a.markerfillhoverratio,hoverFillAngle:a.markerfillhoverangle,borderThickness:m(a.markerborderthickness,1),borderColor:m(a.markerbordercolor,d.markerbordercolor),borderAlpha:l(a.markerborderalpha,
d.markerborderalpha),hoverBorderThickness:a.markerborderhoverthickness,hoverBorderColor:a.markerborderhovercolor,hoverBorderAlpha:a.markerborderhoveralpha,radius:l(a.markerradius&&w.trimString(a.markerradius),7),shapeId:m(a.defaultmarkershape,"circle"),labelSepChar:m(a.labelsepchar,", "),tooltipSepChar:m(a.tooltipsepchar,", "),autoScale:l(a.autoscalemarkers,0),tooltext:m(c&&c.tooltext,a.markertooltext),dataEnabled:q,valueToRadius:l(a.markerradiusfromvalue,1),valueMarkerAlpha:m(a.valuemarkeralpha,
"75"),hideNull:l(a.hidenullmarkers,0),nullRadius:l(a.nullmarkerradius,a.markerradius,7),adjustViewPort:l(a.adjustviewportformarkers,0),startAngle:l(a.markerstartangle,90),maxRadius:l(a.maxmarkerradius,0),minRadius:l(a.minmarkerradius,0),applyAll:l(a.applyallmarkers,0),shadow:l(a.showmarkershadow,a.showshadow,0)};b.connectorOpts={showHoverEffect:l(a.showconnectorhovereffect,1),thickness:l(a.connectorthickness,a.markerconnthickness,"2"),color:m(a.connectorcolor,a.markerconncolor,d.markerbordercolor),
alpha:m(a.connectoralpha,a.markerconnalpha,"100"),hoverThickness:l(a.connectorhoverthickness,a.connectorthickness,a.markerconnthickness,"2"),hoverColor:m(a.connectorhovercolor,a.connectorcolor,a.markerconncolor,d.markerbordercolor),hoverAlpha:m(a.connectorhoveralpha,a.connectoralpha,a.markerconnalpha,"100"),dashed:l(a.connectordashed,a.markerconndashed,0),dashLen:l(a.connectordashlen,a.markerconndashlen,3),dashGap:l(a.connectordashgap,a.markerconndashgap,2),font:m(a.connectorfont,a.markerconnfont,
g),fontColor:m(a.connectorfontcolor,a.markerconnfontcolor,e),fontSize:l(a.connectorfontsize,a.markerconnfontsize,parseInt(k,10)),showLabels:l(a.showconnectorlabels,a.showmarkerlabels,a.showlabels,1),labelBgColor:m(a.connectorlabelbgcolor,a.markerconnlabelbgcolor,d.plotfillcolor),labelBorderColor:m(a.connectorlabelbordercolor,a.markerconnlabelbordercolor,d.markerbordercolor),shadow:l(a.showconnectorshadow,a.showmarkershadow,a.showshadow,0),showTooltip:l(a.showconnectortooltip,a.showmarkertooltip,a.showtooltip,
1),tooltext:m(c&&c.connectortooltext,a.connectortooltext),hideOpen:l(a.hideopenconnectors,1)};b.adjustViewPortForMarkers=l(a.adjustviewportformarkers,q)},_createLayers:function(){var b=this.graphics||(this.graphics={}),a=this.components.paper,b=this.graphics;b.backgroundGroup=b.backgroundGroup||a.group("background");b.canvasGroup=b.canvasGroup||a.group("canvas");b.shadowGroup=b.shadowGroup||a.group("shadow");b.datasetGroup=b.datasetGroup||a.group("dataset");b.datalabelsGroup=b.datalabelsGroup||a.group("datalabel");
b.legendGroup=b.legendGroup||a.group("legend");b.captionGroup=b.captionGroup||a.group("caption");b.captionGroup.trackTooltip(!0);b.datasetGroup.trackTooltip(!0);b.buttonGroup=b.buttonGroup||a.group("buttons")},_createDatasets:function(){var b=this.components,a=this.jsonData,c=this.defaultDatasetType,d=a.data||{},e=a.markers,a=0,g=this.components.dataset,g=b.dataset||(b.dataset=[]);c&&c.toLowerCase();if(c=FusionCharts.get("component",["dataset","Entities"]))g[a]?(g[a].JSONData=d,g[a].configure()):
(b=new c,g.push(b),b.chart=this,b.index=void 0,b.init(d)),a++;c=FusionCharts.get("component",["dataset","Markers"]);b=g[a];c&&e?g[a]?(b.index=void 0,b.init(e),g[a].configure()):(b=new c,g.push(b),b.chart=this,b.index=void 0,b.init(e)):(d=b&&b.type,"markers"===d&&g.splice(a,1))},_parseBackgroundCosmetics:function(){var b=this.components.background.config,a=this.components.colorPalette,c=this.jsonData.chart,d;d=b.showBorder=l(c.showcanvasborder,1);b.borderWidth=d=d?l(c.canvasborderthickness,1):0;b.borderRadius=
b.borderRadius=l(c.canvasborderradius,0);b.borderDashStyle=b.borderDashStyle=l(c.borderdashed,0)?Z(l(c.borderdashlen,4),l(c.borderdashgap,2),d):"none";b.borderColor=b.borderColor=C(m(c.canvasbordercolor,a&&a.borderColor));b.borderAlpha=m(c.canvasborderalpha,a.borderAlpha)},_getBackgroundCosmetics:function(){var b=this.jsonData.chart||this.jsonData.map,a=this.components.colorPalette;return{FCcolor:{color:m(b.bgcolor,b.canvasbgcolor,a.bgcolor),alpha:m(b.bgalpha,b.canvasbgalpha,a.bgalpha),angle:m(b.bgangle,
b.canvasbgangle,a.bgangle),ratio:m(b.bgratio,b.canvasbgratio,a.bgratio)}}},_parseCanvasCosmetics:function(){var b=this.config,a=this.jsonData.chart||this.jsonData.map,c=this.components.canvas.config;b.origMarginTop=l(a.maptopmargin,11);b.origMarginLeft=l(a.mapleftmargin,11);b.origMarginBottom=l(a.mapbottommargin,11);b.origMarginRight=l(a.maprightmargin,11);b.origCanvasLeftMargin=l(a.canvasleftmargin,0);b.origCanvasRightMargin=l(a.canvasrightmargin,0);b.origCanvasTopMargin=l(a.canvastopmargin,0);b.origCanvasBottomMargin=
l(a.canvasbottommargin,0);c.canvasBorderRadius=l(a.canvasborderradius,0);c.origCanvasTopPad=l(a.canvastoppadding,0);c.origCanvasBottomPad=l(a.canvasbottompadding,0);c.origCanvasLeftPad=l(a.canvasleftpadding,0);c.origCanvasRightPad=l(a.canvasrightpadding,0)},draw:function(){this.config.entitiesDrawn=!1;this.config.hasChartMessage?(this._hide(),this.drawChartMessage()):(this._show(),this._createToolBox(),this._manageSpace(),this._updateVisuals(),this.inited=!0,this.chartInstance.jsVars.drawCount+=1,
this.chartInstance.__state.dataReady=!0,this.chartInstance.jsVars.hasNativeMessage=!1)},_drawDataset:function(){var b=this.chartInstance,a=this.components.dataset,c=this.graphics,d=a.length,e=this.config.scalingParams;c.datasetGroup.hide();c.shadowGroup.hide();b.addEventListener("internal.mapdrawingcomplete",function(){return function(a){a.detachHandler();Q&&(c.datasetGroup&&c.datasetGroup.attr({transform:e.transformStr}),c.shadowGroup&&c.shadowGroup.attr({transform:e.transformStr}));c.datasetGroup&&
c.datasetGroup.show();c.shadowGroup&&c.shadowGroup.show()}}());for(b=0;b<d;b++)a[b].draw();this.checkComplete()},preliminaryScaling:function(){for(var b=this.jsonData,a=(b=b.markers&&b.markers.items||[],b.length)||0,c=Infinity,d=Infinity,e=-Infinity,g=-Infinity,k,f;a--;)f=b[a],k=Number(f.x),f=Number(f.y),c=E(c,k),d=E(d,f),e=z(e,k),g=z(g,f);return{x:c,y:d,x1:e,y1:g}},getScalingParameters:function(b,a,c,d){var e=b/a,g=c/(b*this.baseScaleFactor),k=d/(a*this.baseScaleFactor),f=0,h=0;g>k?(g=k,f+=(c-d*
e)/2,b=200/(a*g)):(h+=(d-c/e)/2,b=200/(b*g));return{scaleFactor:g,strokeWidth:b,translateX:f,translateY:h}},calculateMarkerBounds:function(b,a,c){var d=this.config,e=d.markerOpts,g=this.components.dataset,k=this.getDataLimits(),f=k.dataMin,k=k.dataMax,h=e.hideNull,n=e.nullRadius,e=e.valueToRadius,l,m,p,r,q=Infinity,t=Infinity,v=-Infinity,H=-Infinity,w;p=0;for(r=g.length;p<r;p++)d=g[p],m=d.type,"markers"===m&&(l=d);if(l)for(p in l.calculateMarkerRadiusLimits(),m=l.conf||{},g=m.minRadius,m=m.maxRadius,
l=l.components&&l.components.markerObjs||{},l)d=l[p],d=d.config,w=d.definition||{},null!==d.cleanValue?(e&&void 0===w.radius&&(d.radius=g+(m-g)*(d.cleanValue-f)/(k-f)),r=Number(d.radius),d=(Number(w.x)+a)*b,w=(Number(w.y)+c)*b,q=E(q,d-r),t=E(t,w-r),v=z(v,d+r),H=z(H,w+r)):h?d.__hideMarker=!0:null===d.radius&&(d.radius=n);return{x:q,y:t,x1:v,y1:H}},_spaceManager:function(){var b=this.config,a=this.components.legend.config.legendPos,c=this.jsonData.chart,d=b.origMarginLeft,e=b.origMarginTop,g=this.baseWidth,
k=this.baseHeight,f,h={},n=0,m=0,s,h=b.markerOpts,c=b.borderWidth=b.showBorder?l(c.borderthickness,1):0;this._allocateSpace({top:c,bottom:c,left:c,right:c});this._manageLegendSpace("right"===a?.3*b.canvasWidth:.3*b.canvasHeight);a=this._manageChartMenuBar("bottom"===a?.225*b.canvasHeight:.225*b.canvasWidth);c=b.canvasWidth;f=b.canvasHeight;h.dataEnabled?(b.adjustViewPortForMarkers?(h=this.preliminaryScaling(),h.x1>g&&(g=h.x1),0>h.x&&(g+=-h.x,n=-h.x),h.y1>k&&(k=h.y1),0>h.y&&(k+=-h.y,m=-h.y),b=this.getScalingParameters(g,
k,c,f),h=this.calculateMarkerBounds(b.scaleFactor*this.baseScaleFactor,n,m),b=f,s=c,0>h.x&&(d+=-h.x,c+=h.x),0>h.y&&(e+=-h.y,f+=h.y),h.x1>s&&(c-=h.x1-s),h.y1>b&&(f-=h.y1-b)):(b=this.getScalingParameters(g,k,c,f),this.calculateMarkerBounds(b.scaleFactor*this.baseScaleFactor,n,m)),b=this.getScalingParameters(g,k,c,f),d+=n*b.scaleFactor*this.baseScaleFactor,e+=m*b.scaleFactor*this.baseScaleFactor):b=this.getScalingParameters(g,k,c,f);this.config.scalingParams=b;g=b.scaleFactor;b.translateX+=d;b.translateY=
b.translateY+e+a.top||0;b.sFactor=g*this.baseScaleFactor;b.transformStr=["t",b.translateX,",",b.translateY,"s",g,",",g,",0,0"].join("");this.components.mapAnnotations.reset(null,{id:"geo",showbelow:0,autoscale:0,grpxshift:b.translateX?b.translateX:0,grpyshift:b.translateY?b.translateY:0,xscale:100*(g?g*this.baseScaleFactor:1),yscale:100*(g?g*this.baseScaleFactor:1),options:{useTracker:!0}},this);this.components.mapAnnotations._renderer&&(this.components.mapAnnotations._renderer=null)},getFirstId:function(){return this.firstEntity},
getDataLimits:function(){var b=this.components.dataset,a=b.length,c,d=Infinity,e=-Infinity,g;for(g=0;g<a;g++)c=b[g],c=c.getDataLimits(),d=E(d,c.min),e=z(e,c.max);return{dataMin:d,dataMax:e}},getEntityPaths:function(b){var a={},c=this.entities,d;if(b){for(d in c)a[d]=c[d];return a}return c},checkComplete:function(){var b=this.components.mapAnnotations;this.config.entityFlag&&this.config.entitiesReady&&(this.config.entityFlag=!1,b.draw(this),t.raiseEvent("internal.mapdrawingcomplete",{renderer:this},
this.chartInstance))},colorPaletteMap:{basefontcolor:"foregroundcolor",bordercolor:"foregrounddarkcolor",borderalpha:"foregrounddarkalpha",bgcolor:"backgroundlightcolor",bgalpha:"backgroundlightalpha",bgangle:"backgroundlightangle",bgratio:"backgroundlightratio",canvasbordercolor:"foregrounddarkcolor",canvasborderalpha:"foregrounddarkalpha",canvasbgcolor:"backgroundlightcolor",canvasbgalpha:"backgroundlightalpha",canvasbgangle:"backgroundlightangle",canvasbgratio:"backgroundlightratio",tooltipbordercolor:"foregrounddarkcolor",
tooltipborderalpha:"foregrounddarkalpha",tooltipbgcolor:"backgroundlightcolor",tooltipbgalpha:"backgroundlightalpha",tooltipfontcolor:"foregroundcolor",legendbordercolor:"foregrounddarkcolor",legendborderalpha:"foregrounddarkalpha",markerbordercolor:"foregroundlightcolor",markerborderalpha:"foregroundlightalpha",markerfillcolor:"backgrounddarkcolor",markerfillalpha:"backgrounddarkalpha",markerfillangle:"backgrounddarkangle",markerfillratio:"backgrounddarkratio",plotfillcolor:"backgroundcolor",plotfillalpha:"backgroundalpha",
plotfillangle:"backgroundangle",plotfillratio:"backgroundratio",plothoverfillcolor:"backgrounddarkcolor",plothoverfillalpha:"backgrounddarkalpha",plothoverfillangle:"backgrounddarkangle",plothoverfillratio:"backgrounddarkratio",plotbordercolor:"foregroundcolor",plotborderalpha:"foregroundalpha",shadow:"shadow"},eiMethods:{getMapName:function(){return this.jsVars.instanceAPI.name},getEntityList:function(){var b=this.jsVars.instanceAPI.components.dataset||[],a,c,d,e=b.length,g=[],k;for(a=0;a<e;a++)if(d=
b[a]||[],k=d.type,"entity"===k){c=d;break}b=c.components.data;for(a in b)b.hasOwnProperty(a)&&(c=b[a]||{},c=c.config||{},g.push({id:c.id,originalId:c.originalId||c.id,label:c.label,shortlabel:c.shortLabel,value:c.value,formattedValue:c.formattedValue,toolText:c.toolText}));return g},getMapAttribute:function(){t.raiseWarning(this,"12061210581","run","JavaScriptRenderer~getMapAttribute()",'Use of deprecated "getMapAttribute()". Replace with "getChartAttribute()".');return this.getChartAttribute.apply(this,
arguments)},exportMap:function(){t.raiseWarning(this,"12061210581","run","JavaScriptRenderer~exportMap()",'Use of deprecated "exportMap()". Replace with "exportChart()".');return this.exportChart&&this.exportChart.apply(this,arguments)},addMarker:function(b){var a=this.jsVars.instanceAPI.components.dataset||[],c=a.length,d,e,g,k;for(d=0;d<c;d++)if(e=a[d]||[],k=e.type,"markers"===k){g=e;break}g&&!g.addMarkerItem(b)&&t.raiseWarning(this,"1309264086","run","MapsRenderer~addMarker()","Failed to add marker. Check the options and try again.")},
updateMarker:function(b,a){var c=this.jsVars.instanceAPI.components.dataset||[],d=c.length,e,g,k,f;for(e=0;e<d;e++)if(g=c[e]||[],f=g.type,"markers"===f){k=g;break}k&&b&&(b=(b+"").toLowerCase(),k.updateMarkerItem(b,a))},removeMarker:function(b){var a=this.jsVars.instanceAPI.components.dataset||[],c=a.length,d,e,g,k;for(d=0;d<c;d++)if(e=a[d]||[],k=e.type,"markers"===k){g=e;break}b&&(b=(b+"").toLowerCase(),g._removeMarkerItem(b))}},_createAxes:function(){}},I.mscartesian);FusionCharts.register("component",
["caption","MapCaption",{configure:function(){var b=this.chart,a=b.jsonData.chart,c=b.components,d=c.caption.config,e=b.config.style,b=e.outCanfontFamily,g=e.outCancolor,e=e.fontSize,k=["top","center"],c=c.subCaption.config;d.style={fontFamily:m(a.captionfont,b),color:C(m(a.captionfontcolor,g).replace(/^#? ([a-f0-9]+)/ig,"#$1")),fontSize:l(a.captionfontsize,e+3)+"px",fontWeight:0===l(a.captionfontbold)?"normal":"bold"};d.align=c.align=m(a.captionposition,"center");d.align&&(k=d.align.split("-"),k[0]&&
(k[0]=k[0].toLowerCase()),k[1]&&(k[1]=k[1].toLowerCase()));d.isOnTop="bottom"===k[0]?c.isOnTop=0:c.isOnTop=1;switch(k[1]){case "right":d.align="end";break;case "left":d.align="start";break;default:d.align="middle"}d.alignWithCanvas=c.alignWithCanvas=l(a.aligncaptionwithcanvas,1);d.horizontalPadding=c.horizontalPadding=l(a.captionhorizontalpadding,d.alignWithCanvas?0:15);d.drawCaption=!0;T(d.style);c.style={fontFamily:m(a.subcaptionfont,a.captionfont,b),color:C(m(a.subcaptionfontcolor,a.captionfontcolor,
g).replace(/^#? ([a-f0-9]+)/ig,"#$1")),fontSize:l(a.subcaptionfontsize,l(z(l(a.captionfontsize)-3,-1),e)+l(this.subTitleFontSizeExtender,1))+"px",fontWeight:0===l(a.subcaptionfontbold,this.subTitleFontWeight,a.captionfontbold)?"normal":"bold"};T(c.style)}},"Caption"]);FusionCharts.register("component",["dataset","Entities",{customConfigFn:"_createDatasets",type:"entity",configure:function(){var b=this.chart,a=b.jsonData,c=this.conf,d=b.components,e=a.map||a.chart,g,b=w.nonGradientColorRange,k=(a.colorrange||
{}).gradient,f=d.postLegendInitFn,h=d.numberFormatter,n,m={},d=a.entitydef||[];g=a.data&&a.data[0]&&a.data[0].data?this.JSONData=a.data[0].data||[]:this.JSONData=a.data||[];c.useSNameAsId=l(e.usesnameasid,0);this._redefineEntities(d);d=this.components.data;c.showTooltip=l(e.showtooltip,1);c.showHoverEffect=l(e.showhovereffect,0);g=(c=g)&&c.length||0;for(e={};g--;)m=c[g],void 0!==m.id&&(e[m.id.toLowerCase()]=m);g=e;this.calculateDataLimits();m=this.getDataLimits();k?f({min:m.min,max:m.max}):this.components.colorRange=
new b({colorRange:a.colorrange,dataMin:m.min,dataMax:m.max,defaultColor:"#00ff00",numberFormatter:h});for(n in d)a=g[n],b=d[n],b.dataset=this,a?this._configureEntity(n,b,L(this._sanitizeEntityOptions(A({},a)),b.config)):this._configureEntity(n,b,b.config);this._addLegend()},init:function(b){this.JSONData={data:b};this.components={};this.conf={};this.graphics={};this.configure()},updateEntityColors:function(b,a){var c=this.components.data,d=this.chart,e,g,k,f,h={"fill-opacity":0};for(f in c)e=c[f],
g=e.config,k=g.cleanValue,g=g.alphaArr||[],g={"fill-opacity":g[0]/100||1},k<b||k>a?(this.setCustomAttrs(e,h,d),e.hidden=!0):(e.hidden=!1,this.setCustomAttrs(e,g,d))},_addLegend:function(){var b=this.chart.components.legend,a=(this.components.colorRange||{}).colorArr||[],c=this.components.entityColorMap=this.components.entityColorMap||(this.components.entityColorMap=[]),d,e,g=a.length,k,f,h;b.emptyItems();e=c.length=0;for(g=a.length;e<g;e++)d=a[e],f=m(d.code,d.color),k=W(f,60).replace(M,Y),h=W(f,40),
f={FCcolor:{color:f+","+f+","+h+","+f+","+f,ratio:"0,70,30",angle:270,alpha:"100,100,100,100,100"}},k={fillColor:v(f),label:m(d.label,d.displayvalue),strokeColor:v(k),legendItemId:d.legendItemId},(f=c[e])||(f=c[e]={config:{}}),f.config=d,f.visible=!0,f.dataset=this,f.legendItemId=b.addItems(f,this.legendInteractivity,k)},legendInteractivity:function(b,a){var c=this.config,d=b.config,e=b.visible,g=b.dataset,k=g.chart,f=g.components.data,h,n,l=a.config,m=a.graphics,p,r=g.components.colorRange,q=c.itemHiddenStyle.color,
c=c.itemStyle.color,t=l.fillColor;n={};var v,w={},A={"fill-opacity":0},C=l.strokeColor;b.visible=!e;for(h in f)f.hasOwnProperty(h)&&(n=f[h],l=n.config,p=l.cleanValue,p=r.getColorObj(p),l=l.visibleEntityAttr,w["fill-opacity"]=l["fill-opacity"],l=e?A:w,d.code===p.code&&(n.hidden=e?!0:!1,g.setCustomAttrs(n,l,k)));n={legendItemSymbol:{fill:e?q:t,stroke:e?q:C},legendItemText:{fill:e?q:c},legendIconLine:{stroke:e?q:t}};for(v in m)(d=m[v])&&d.attr&&d.attr(n[v])},setCustomAttrs:function(b,a,c){var d=c.get("config",
"animationObj");c=d.transposeAnimDuration;d=d.animType;b&&(b=b.graphics,b=b.outlines,b.animate(a,c,d))},calculateDataLimits:function(){var b=this.chart,a=this.conf,c=b.jsonData.data||[],b=b.components.numberFormatter,d,e=Infinity,g=-Infinity,k,f;f=0;for(k=c.length;f<k;f++)d=c[f].value,d=b.getCleanValue(d),e=E(e,d),g=z(g,d);a.max=g;a.min=e},_configureEntity:function(b,a,c){var d=this.chart,e=this.conf,g=d.jsonData,k=d.components,f=k.numberFormatter,d=d.config.entityOpts,h=a.config,n=a.labelConfig,
u=c.value,s=g.colorrange&&g.colorrange.gradient,p=(k=k.gradientLegend)&&k.colorRange,r=this.components.colorRange,k=h.cleanValue=f.getCleanValue(u),f=h.formattedValue=k?f.dataLabels(k):void 0,g=l(c.showtooltip,d.showTooltip),q=this._getDefaultTooltip.call(a,c,this),t={formattedValue:f,sName:c.shortLabel,lName:c.label},v=d.dataLabels.style,g=h.toolText=g?S(m(O(m(c.tooltext,d.tooltext,q),[1,2,7,38,39],t,c))):"",t=h.borderColor=m(c.bordercolor,d.borderColor),w=h.borderAlpha=m(c.borderalpha,d.borderAlpha),
A=h.borderThickness=l(c.borderthickness,d.borderThickness),z=h.useHoverColor=l(c.showhovereffect,c.usehovercolor,d.hoverOnNull?d.showHoverEffect:isNaN(u)?0:d.showHoverEffect),q=h.labelAlignment,u=d.labelSepChar,G;a.hidden=!1;h.showLabel=l(c.showlabel,d.showLabels);h.labelPadding=l(c.labelpadding,d.labelPadding);h.fontFamily=m(c.font,v.fontFamily);h.fontSize=l(parseInt(c.fontsize,10),parseInt(v.fontSize,10));h.fontBold=l(c.fontbold,0);h.fontColor=m(c.fontcolor,v.color);h.connectorColor=m(c.labelconnectorcolor,
d.connectorColor);h.connectorAlpha=m(c.labelconnectoralpha,d.connectorAlpha);h.hoverBorderThickness=l(c.borderhoverthickness,c.hoverborderthickness,d.hoverBorderThickness);h.hoverBorderColor=m(c.borderhovercolor,c.hoverbordercolor,d.hoverBorderColor,h.borderColor);h.hoverBorderAlpha=m(c.borderhoveralpha,c.hoverborderalpha,d.hoverBorderAlpha,h.borderAlpha);h.connectorThickness=l(c.labelconnectorthickness,d.connectorThickness);h.origConnectorThickness=h.connectorThickness;h.borderThickness=A;h.link=
c.link;h.isVisible=!0;h.id=b;h.originalId=c.origId;k&&(p&&s?G=p.getColorByValue(k):r&&(b=r.getColorObj(k),G=m(b.color,b.code)));void 0!==m(c.color,c.alpha,c.angle,c.ratio)?(G=m(c.color,G,d.fillColor),b=m(c.alpha,d.fillAlpha),s=m(c.angle,d.fillAngle),p=m(c.ratio,d.fillRatio),G=U({color:G,alpha:b,angle:s,ratio:p})):(G=U({color:m(G,d.fillColor),alpha:m(d.fillAlpha),angle:m(d.fillAngle),ratio:m(d.fillRatio)}),b=U({color:m(d.nullEntityColor),alpha:m(d.nullEntityAlpha),angle:m(d.nullEntityAngle),ratio:m(d.nullEntityRatio)}),
G=null===k?b:G,b=G.FCcolor.alpha);""===g&&(e.showTooltip=0);h.visibleEntityAttr={stroke:C(t,w),fill:(h.fillColor=G).toString(),"fill-opacity":b/100};e=b.split(",");h.alphaArr=e;z&&(void 0!==m(c.fillhovercolor,c.fillhoveralpha,c.fillhoverangle,c.fillhoverratio,c.hoverfillcolor,c.hoverfillalpha,c.hoverfillratio,c.hoverfillangle)?(G=m(c.fillhovercolor,c.hoverfillcolor,d.hoverFillColor),b=m(c.fillhoveralpha,c.hoverfillalpha,d.hoverFillAlpha),s=m(c.fillhoverangle,c.hoverfillangle,d.hoverFillAngle),p=m(c.fillhoverratio,
c.hoverfillratio,d.hoverFillRatio),e=U({color:G,alpha:b,angle:s,ratio:p})):(d.hoverColorObject||(d.hoverColorObject=U({color:d.hoverFillColor,alpha:d.hoverFillAlpha,angle:d.hoverFillAngle,ratio:d.hoverFillRatio})),e=d.hoverColorObject),h.hoverColor=e);!n&&(n=a.labelConfig={});e=h.fontColor;b=h.fontFamily;t=h.fontBold;g=h.toolText;q?(a=q[0],q=q[1]):(a="center",q="middle");n.align=a;n.vAlign=q;n.bgColor="";n.borderColor="";n.fontColor=e;n.fontFamily=b;n.fontBold=t;n.toolText=g;"undefined"!==typeof c.displayvalue?
c=c.displayvalue:(c=m(d.includeNameInLabels?d.useShortName?h.shortLabel:h.label:""),d.includeValueInLabels&&null!==k&&(c=void 0===c?f:c+u+f));n.displayValue=c},_sanitizeEntityOptions:function(b){delete b.outlines;delete b.label;delete b.shortlabel;delete b.labelposition;delete b.labelalignment;delete b.labelconnectors;return b},_redefineEntities:function(b){var a=this.conf,c={},d={},e=this.chart.entities,g=a.useSNameAsId,k,f,h,n,l,m,p,r=0,q,t;for(k=b.length;k--;)if(f=b[k],h=f.internalid,n=f.newid?
f.newid:h,l=f.sname,m=f.lname,q=e[h],h=w.trimString(h),n=(n=w.trimString(n))&&n.toLowerCase(),q){c[n]=n={origId:h};d[h]=!0;for(t in q)n[t]=q[t];n.shortLabel=l?l:q.shortLabel;n.label=m?m:q.label;n.showhovereffect=f.showhovereffect;n.fillhovercolor=f.fillhovercolor;n.fillhoveralpha=f.fillhoveralpha;n.fillhoverangle=f.fillhoverangle;n.fillhoverratio=f.fillhoverratio;n.borderhoverthickness=f.borderhoverthickness}q=this.components.data;q||(q=this.components.data={});for(p in c)p=p.toLowerCase(),q[p]||
(q[p]={config:{}}),q[p].config=c[p],r+=1;c=q;for(p in e)if(n=e[p],p=w.trimString(p),!d[p]){g?((q=c[n.shortLabel.toLowerCase()])||(q=c[n.shortLabel.toLowerCase()]={}),q.config={},q.origId=n.shortLabel):((q=c[p.toLowerCase()])||(q=c[p.toLowerCase()]={}),q.config={},q.config.origId=p);for(t in n)q.config[t]=n[t];r+=1}a.entityCount=r},draw:function(){var b=this.conf,a=Q?100:50,c=this.chart;this.conf.ready=!1;b.BATCH_SIZE=a;this._batchRender()();c.config.entityFlag=!0},_batchRender:function(){var b=this,
a=b.conf,c=b.components.data,d=a.BATCH_SIZE,e=a.entityCount,g=Object.keys(c),k=g.length,f=0,h,n,l,m=function(){l=0;for(h=f;h<k&&(n=c[g[h]],b.drawEntity(n),l+=1,f+=1,l!==d);h++);l<e?(e-=l,setTimeout(m,0)):b.initComplete()};return m},_getDefaultTooltip:function(b){var a=this.dataset,c=this.config.cleanValue,d=this.config.formattedValue,e=a.chart.config.entityOpts;if(a.hasFeature.apply(this,["_ds"])){b=b.labels&&b.labels[0];if(!b)return;c=(e.useSNameInTooltip?b.shortText:b.text)+(isNaN(c)?"":e.tooltipSepChar+
d)}else c=(e.useSNameInTooltip?b.shortLabel:b.label)+(null===c?"":e.tooltipSepChar+d);return c},hasFeature:function(b){var a=this.featureConfig;return a&&"undefined"!==typeof a[b]?Boolean(a[b]):!1},drawEntity:function(b){var a=this.chart,c=a.config,d=a.components,e=d.gradientLegend,d=d.paper,g=b.config,k=Q||!P?"litepath":"path",f=a.config.entityOpts,h=a.config.scalingParams,n=g.outlines,l=a.graphics.datasetGroup,m=a.graphics.shadowGroup,p=!P||Q,r=h.scaleFactor,q=h.strokeWidth,t=(p?a.baseScaleFactor:
1)*q,v=1===f.scaleBorder,w=g.borderThickness,A=g.toolText,C=f.shadow,f=[],G=g.origConnectorThickness,F=g.hoverBorderThickness,D=g.visibleEntityAttr,B=D["fill-opacity"],a={scalefactor:[r,r*a.baseScaleFactor],opacity:z.apply($,g.alphaArr)/100};e&&!0===c.gLegendEnabled&&(b.hidden=!1);B=b.hidden?0:B;e&&e.enabled&&(e.resetLegend(),e.clearListeners());e&&e.notifyWhenUpdate(this.updateEntityColors,this);p?(w=g.entityBorderThickness=v?w*t:w/r,G/=r,F&&(g.hoverBorderThickness=v?F*t:F/r)):w=v?w*q:w;g.entityBorderThickness=
w;g.connectorThickness=G;D["stroke-width"]=w;D.transform=Q||!P?"":h.transformStr;c=n.length;b.graphics||(b.graphics={});if(C){for(;c--;)e=n[c],f=e.concat(f);b.graphics.outlines?b.graphics.outlines.attr(D).attr({"fill-opacity":B}).tooltip(A).shadow(a,m):b.graphics.outlines=d[k](f,l).attr(D).tooltip(A).shadow(a,m)}else{for(;c--;)e=n[c],f=e.concat(f);b.graphics.outlines?b.graphics.outlines.attr(D).attr({"fill-opacity":B}).tooltip(A):b.graphics.outlines=d[k](f,l).attr(D).tooltip(A)}this.addMouseGestures.call(b)},
drawLabels:function(b){var a=[],c,d=b.chart.components.mapAnnotations,e={id:"entityLabels",items:a};for(c in this)b.drawLabel.call(this[c],a);d.addGroup(e)},_getLabelObject:function(b,a){var c=this,d=c.dataset,e=d.chart,g=c.config,k=c.labelConfig,f=e.config.scalingParams,h=g.labelPosition,l=g.labelAlignment,m=c.graphics&&c.graphics.outlines,s=g.style=g.style||(g.style={}),p=g.fontSize,r=g.labelPadding,q;h?(m=h[0],h=h[1]):(h=m.getBBox(),m=h.x+h.width/2,h=h.y+h.height/2);l?(q=l[0],l=l[1],"right"===
q?m-=r:"left"===q&&(m+=r),"top"===l?h-=r:"bottom"===l&&(h+=r)):(q="center",l="middle");p=parseFloat(p)/f.sFactor;!a&&s&&(s.color&&(k.fontColor=s.color),s["font-size"]&&(p=parseFloat(s["font-size"])/f.sFactor),s["font-family"]&&(k.fontFamily=s["font-family"]),void 0!==s["font-weight"]&&(k.fontBold="bold"===s["font-weight"]));k.x=m.toString();k.y=h.toString();k.wrap=1;k.type="text";k.fontSize=p;return{x:m.toString(),y:h.toString(),wrapwidth:ca[q](void 0,m+void 0)-r,wrapheight:da[l](void 0,h+void 0)-
r,wrap:1,type:"text",align:k.align,valign:k.vAlign,text:k.displayValue,tooltext:k.toolText,link:k.link,bgcolor:k.bgColor,bordercolor:k.borderColor,fillcolor:k.fontColor,fontsize:k.fontSize,font:k.fontFamily,bold:k.fontBold,onclick:function(a){t.raiseEvent("entityclick",g.eventArgs,e.chartInstance,a)},onmouseover:function(a){d.entityRollOver.call(c.graphics.outlines,a)},onmouseout:function(a){d.entityRollOut.call(c.graphics.outlines,a)},ontouchstart:function(a){d.entityRollOver.call(c.graphics.outlines,
a)}}},drawLabel:function(b){var a=this.dataset,c=this.config;c.showLabel&&(b.push(a._getLabelObject.call(this,!0,!0)),c.labelConnectors&&a.drawLabelConnectors.call(this,c.labelConnectors))},drawLabelConnectors:function(b){for(var a=this.config,c=this.dataset.chart,d=c.components.paper,c=c.graphics.datasetGroup,e=b&&b.length||0,g,k;e--;)k=b[e],g=this.graphics.connectorElem,g||(this.graphics.connectorElem=g=d.path(k,c)),g.attr({transform:"",stroke:C(a.connectorColor,a.connectorAlpha),"shape-rendering":"crisp",
"stroke-width":a.connectorThickness})},entityClick:function(b){var a=this.node.__entity,c=a.dataset.chart,d=c.linkedItems.linkClickFN,a=a.config,e=a.link;t.raiseEvent("entityclick",a.eventArgs,c.chartInstance,b);void 0!==e&&d.call({link:e},c)},entityRollOver:function(b){var a=this.node.__entity,c=a.config,d=a.dataset.chart,e=c.hoverAttr;w.plotEventHandler.call(this,d,b,"entityRollOver");this.data("hovered")?clearTimeout(a.config.timer):c.useHoverColor&&c.isVisible&&!a.hidden&&(d.config.hoverEntity=
this,this.attr(e),this.data("hovered",!0))},entityRollOut:function(b){var a=this,c=this.node.__entity,d,e=c.config.revertAttr;w.plotEventHandler.call(a,c.dataset.chart,b,"entityRollOut");c.config.timer=setTimeout(function(){d=c.hidden;!0!==d&&(a.attr(e),a.data("hovered",!1))},100)},addMouseGestures:function(){var b=this.config,a=this.dataset,c=this.graphics,d=b.hoverBorderThickness,e=b.hoverBorderColor,g=b.hoverBorderAlpha,k=b.entityBorderThickness,f=b.borderColor,h=b.borderAlpha,m=b.link,u=b.visibleEntityAttr,
s="groupId"+b.originalId,p;b.eventArgs={value:b.value,label:b.label,shortLabel:b.shortLabel,originalId:b.origId,id:b.id||b.origId};b.legacyEventArgs={value:b.value,lName:b.label,sName:b.shortLabel,id:b.originalId||b.id};b.hoverAttr={fill:v(b.hoverColor)};b.revertAttr={fill:v(b.fillColor),stroke:v(b.borderColor,b.borderAlpha)};b.revertAttr["fill-opacity"]=u["fill-opacity"];d!==k&&(b.hoverAttr["stroke-width"]=l(d,k),b.revertAttr["stroke-width"]=k);if(e!==f||g!==h)b.hoverAttr.stoke=C(e,g),b.revertAttr.stroke=
C(f,h);for(p in c)void 0!==m&&c[p].css({cursor:"pointer",_cursor:"hand"}),c[p].data("eventArgs",b.eventArgs),c[p].data("groupId",s),c[p].node.__entity=this,this._listenersBinded||c[p].click(a.entityClick).hover(a.entityRollOver,a.entityRollOut),this._listenersBinded=!0},getDataLimits:function(){var b=this.conf;return{max:b.max,min:b.min}},initComplete:function(){var b=this.chart;this.drawLabels.call(this.components.data,this);b.config.entitiesReady=!0;b.checkComplete()}}]);FusionCharts.register("component",
["dataset","Markers",{type:"markers",configure:function(){var b=this.chart.config.markerOpts;this.calculateDataLimits();b.dataEnabled?this._parseMarkers():this.defineMarkersNShapes();this.configureConnectors()},init:function(b){this.JSONData=b;this.components={};this.conf={};this.graphics={};this.configure()},calculateMarkerRadiusLimits:function(){var b=this.JSONData,a=this.conf,c=this.chart,b=this.getMarkerRadiusLimits(c.config.width,c.config.height,b.markermaxradius,b.markerminradius);a.minRadius=
b.min;a.maxRadius=b.max},calculateDataLimits:function(){var b=this.chart,a=this.conf,c=(b.jsonData.markers||{}).items||[],b=b.components.numberFormatter,d=Infinity,e=-Infinity,g,k,f;f=0;for(k=c.length;f<k;f++)g=c[f],g=g.value,g=b.getCleanValue(g),null!==g&&(d=E(g,d),e=z(g,e));a.min=d;a.max=e},_parseMarkers:function(){var b=this.chart,a=b.jsonData.markers,c=a.items,d=a.shapes,a=b.config.markerOpts,e=b.components.numberFormatter,g=this.components.shapeObjs=this.components.shapeObjs||(this.components.shapeObjs=
{}),k=this.components.markerObjs=this.components.markerObjs||(this.components.markerObjs={}),f,h,n,u,s,p,r;if(c&&c.length){if(d&&d.length)for(f=d.length;f;--f)if(n=d[f-1],r=n.id.toLowerCase())g[r]=n;for(f=c.length;f--;)if(n=c[f],r=n.id&&n.id.toLowerCase())d=n.value,void 0!==d&&""!==d&&(d=parseFloat(d)),h=this._initializeMarkerItem(r,n,null,b),(u=h.config.options.shapeid)&&"string"===typeof u&&(u=u.toLowerCase()),s=h.config,p=s.options,s.cleanValue=e.getCleanValue(d),s.formattedValue=null!==s.cleanValue?
e.dataLabels(d):void 0,s.fillColor=m(p.fillcolor,p.color,a.fillColor),s.fillAlpha=m(p.fillalpha,p.alpha,a.fillAlpha),s.fillRatio=m(p.fillratio,a.fillRatio),s.fillAngle=m(p.fillangle,a.fillAngle),s.borderThickness=l(p.borderthickness,a.borderThickness),s.borderColor=m(p.bordercolor,a.borderColor),s.borderAlpha=m(p.borderalpha,a.borderAlpha),s.labelPadding=p.labelpadding||a.labelPadding,h.dataset=this,n.__hideMarker&&(h._isHidden=!0),u&&(h.shapeObj=g[u]),k[r]=h}},defineMarkersNShapes:function(){var b=
this.chart,a=b.jsonData.markers,c=a.definition,d=b.components.numberFormatter,e=b.config.markerOpts,g=X(c)||{},k=X(a.application)||{},f=a.shapes,a=this.components.shapeObjs=this.components.shapeObjs||(this.components.shapeObjs={}),h=this.components.markerObjs=this.components.markerObjs||(this.components.markerObjs={}),n,u,s,p;if(c&&c.length){if(f&&f.length)for(c=f.length;c;--c)if(n=f[c-1],p=n.id.toLowerCase())a[p]=n;for(p in g)n=g[p],c=h[p]=this._initializeMarkerItem(p,n,k[p],b),c.dataset=this,s=
c.config.options.shapeid,f=c.config,u=n.value,f.cleanValue=d.getCleanValue(u),n=f.options,f.formattedValue=null!==f.cleanValue?d.dataLabels(u):void 0,f.fillColor=m(n.fillcolor,n.color,e.fillColor),f.fillAlpha=m(n.fillalpha,n.alpha,e.fillAlpha),f.fillRatio=m(n.fillratio,e.fillRatio),f.fillAngle=m(n.fillangle,e.fillAngle),f.borderThickness=l(n.borderthickness,e.borderThickness),f.borderColor=m(n.bordercolor,e.borderColor),f.borderAlpha=m(n.borderalpha,e.borderAlpha),f.labelPadding=n.labelpadding||e.labelPadding,
f.options.tooltext=m(n.tooltext,e.tooltext),f.link=n.link,s&&(c.shapeObj=a[s.toLowerCase()])}},getMarkerRadiusLimits:function(b,a,c,d){a=E(b,a);b=.02*a;a*=.07;d=parseFloat(d);c=parseFloat(c);return isNaN(d)||isNaN(c)?isNaN(d)?isNaN(c)?{min:b,max:a}:{min:parseInt(c/10,10),max:c}:{min:d,max:10*d}:d<c?{min:d,max:c}:{min:c,max:d}},getDataLimits:function(){var b=this.conf;return{min:b.min,max:b.max}},_initializeMarkerItem:function(b,a,c){var d={},e=d.config;e||(e=d.config={});e.id=b;e.definition=a;e.application=
c;e.hasValue=null;e.value=null;e.options=null;e.label=null;e.markerShape=null;e.markerLabel=null;e.drawOptions={shape:null,label:null};e.drawComplete=!1;b=d.config.options=A({},e.definition);e.dataEnabled?isNaN(b.value)||""===b.value||(d.value=parseFloat(b.value),d.hasValue=!0):e.applyAll?e.options=A(b,e.application):c&&(e.options=A(b,e.application));return d},configureConnectors:function(){var b=this.chart,a=b.jsonData.markers||{},a=a.connector||a.connectors||[],c=this.components.markerObjs,d=a.length,
e=this.components.connectors,g=function(a){return function(c){var d=c.data,e=d.wrapper;e&&d.options.hoverEffect&&e.attr(d.options._hoverAttrs);t.raiseEvent("connectorrollover",a,b.chartInstance,c)}},k=function(a){return function(c){var d=c.data,e=d.wrapper;e&&d.options.hoverEffect&&e.attr(d.options._defaultAttrs);t.raiseEvent("connectorrollout",a,b.chartInstance,c)}},f=function(a){return function(c){t.raiseEvent("connectorClick",a,b.chartInstance,c)}},h=b.config.connectorOpts,n={},u,s,p,r,q,v,w,C,
z,E,G,F,D;e||(e=this.components.connectors=[]);for(D=0;D<d;D++)if(F=a[D],F.from||F.to)s=c[F.from.toLowerCase()],p=c[F.to.toLowerCase()],s&&p&&(r=a[D].label,n=e[D],!n&&(n=e[D]={}),!n.config&&(u=n.config={}),!n.graphics&&(n.graphics={}),u=n.config=A({},F),u.fromMarker=s,u.toMarker=p,u.link=F.link,u.showTooltip=l(F.showtooltip,h.showTooltip),q=u.tooltext=u.showTooltip?m(F.tooltext,h.tooltext):"",v=u.thickness=m(F.thickness,h.thickness),w=u.color=m(F.color,h.color),C=u.alpha=m(F.alpha,h.alpha),u.hoverEffect=
l(F.showhovereffect,h.showHoverEffect),z=m(F.hovercolor,h.hoverColor,w),E=m(F.hoveralpha,h.hoverAlpha,C),G=m(F.hoverthickness,h.hoverThickness,v),u.dashed=m(F.dashed,h.dashed),u.dashLen=l(F.dashlen,h.dashlen),u.dashGap=l(F.dashgap,h.dashgap),q&&(u.tooltext=q=S(O(q,[3,40,41,42,43],{label:r,fromId:s.config.definition.id,toId:p.config.definition.id,fromLabel:s.config.definition.label,toLabel:p.config.definition.label},void 0))),u.eventArgs={fromMarkerId:s.config.id,toMarkerId:p.config.id,label:r},u._hoverAttrs=
{stroke:U({color:z,alpha:E}).toString(),"stroke-width":G},u._defaultAttrs={stroke:U({color:w,alpha:C}).toString(),"stroke-width":v},u.type="line",u.onclick=f(u.eventArgs),u.onmouseover=g(u.eventArgs),u.onmouseout=k(u.eventArgs),r&&(u=n.labelConfig,!u&&(u=n.labelConfig={}),u.type="text",u.text=r,u.align="center",u.valign="middle",u.font=h.font,u.fillcolor=h.fontColor,u.bgcolor=h.labelBgColor,u.bordercolor=h.labelBorderColor,u.tooltext=h.tooltext))},draw:function(){var b=this.chart,a=this.conf,c=b.components.mapAnnotations,
d=this.components.markerObjs,e=b.config,g=e.markerOpts,k=e.scalingParams,e=[],f=[],h,l,m;l=c.addGroup({items:f});m=c.addGroup({fillalpha:"100",items:e});this.components.markerGroup=m;this.components.markerLabelGroup=l;a.autoScale=g.autoScale?k.sFactor:1;for(h in d)a=null,g=d[h],k=g.config,k.conIsHidden||(a=this._drawMarkerItem.call(g)),a&&(k._annotationIndex=e.length,g.markerShape=a.markerShape&&m.addItem(a.markerShape,!1,b),e.push(g.markerShape),g.markerLabel=a.markerLabel&&l.addItem(a.markerLabel,
!1,b),f.push(g.markerLabel));this._drawConnectors();if(!b.config.entityOpts.labelsOnTop){b=c.groups;for(d=0;d<b.length&&(h=b[d],h=h._id,"entityLabels"!==h);d++);h=b.splice(d,1);h={id:"entityLabels",items:h[0]&&h[0].options.items};c.addGroup(h)}},_drawMarkerItem:function(){var b=this,a=b.dataset,c=a.chart,d=c.config,e=a.conf,g=d.scalingParams,k=b.config,f=k.options,h=k.definition,n=d.markerOpts,u=g.translateX,s=g.translateY,d=n.dataLabels.style,p=f.shapeid,r=f.scale||1,q=f.label||"",w=c.config.scalingParams.scaleFactor*
c.baseScaleFactor,z=(f.labelpos||"top").toLowerCase(),H=void 0===k.formattedValue?void 0:k.formattedValue,E=f.tooltext,e=l(h.radius,k.radius,n.radius)*r*e.autoScale||1E-4,h=k.fillColor,J=k.fillAlpha,G=k.fillRatio,F=k.fillAngle,D=k.borderThickness,B=k.borderColor,y=k.borderAlpha,x,I;k.autoScale=n.autoScale?w:1;if(p){E=E?S(O(E,[1,2,3],{formattedValue:H,label:q},f)):H?q+n.tooltipSepChar+H:q;void 0!==H&&null!==H?q=q+n.labelSepChar+H:isNaN(r)?r=1:0>r?r=0:5<r&&(r=5);x=function(){var a=b.markerShape,d=a.options,
e=a.bounds,f=d._markerEventArgs,g=a.wrapper,h=a.fillOptions;g&&d.hovereffect&&("circle"===a.type&&(a={color:d.hoverfillcolor,alpha:d.hoverfillalpha,angle:360-d.hoverfillangle,ratio:d.hoverfillratio,gradientUnits:"objectBoundingBox",radialGradient:h.radialGradient,cx:h.cx,cy:h.cy},d._hoverattrs.fill=v(a)),a=A({},d._hoverattrs),"image"===g.type&&(delete a.fill,delete a.stroke,delete a["stroke-width"]),g.attr(a));f||(f=d._markerEventArgs={x:e.x1/e.xs,y:e.y1/e.ys,scaledX:e.x1,scaledY:e.y1,chartX:u+e.x1,
chartY:s+e.y1,id:d._markerId,label:d._markerLabel});t.raiseEventGroup(k.id,"markerRollOver",f,c.chartInstance,k,void 0,void 0,void 0)};I=function(){var a=b.markerShape,d=a.wrapper,e=a.fillOptions;d&&a.options.hovereffect&&("circle"===a.type&&(f._defaultattrs.fill=v(e)),e=A({},a.options._defaultattrs),"image"===d.type&&(delete e.fill,delete e.stroke,delete e["stroke-width"]),d.attr(e));t.raiseEventGroup(k.id,"markerRollOut",a.options._markerEventArgs,c.chartInstance,void 0,void 0,void 0)};A(f,{x:f.x.toString(),
y:f.y.toString(),fillcolor:h,fillalpha:J,fillratio:G,fillangle:F,borderthickness:D,bordercolor:B,borderalpha:y,hovereffect:m(n.showHoverEffect),radius:e.toString(),tooltext:n.showTooltip?E:0,link:f.link,showshadow:l(f.showshadow,k.shadow),_markerLabel:q,_markerId:f.id,id:(f.id+"").toLowerCase(),onmouseover:function(){x()},onmouseout:function(){I()},onclick:function(a){t.raiseEvent("markerClick",a.data.options._markerEventArgs,c.chartInstance,a)}});"triangle"===p?A(f,{type:"polygon",sides:3,startangle:n.startAngle}):
"diamond"===p?A(f,{type:"polygon",sides:4,startangle:n.startAngle}):"arc"===p?A(f,{type:"arc",startangle:0,endangle:360,innerradius:.6*e}):"circle"===p?f.type="circle":(p=a.getShapeArgs.call(b),n.dataEnabled&&n.valueToRadius&&void 0!==f.radius?delete p.radius:(!p.radius&&(p.radius=n.radius),p.radius=p.radius*r*k.autoScale),A(f,p),f.id=f._markerId&&f._markerId.toLowerCase());A(f,{hoverfillcolor:m(f.fillhovercolor,n.hoverFillColor,f.fillcolor),hoverfillalpha:m(f.fillhoveralpha,n.hoverFillAlpha,f.fillalpha),
hoverfillratio:m(f.fillhoverratio,n.hoverFillRatio,f.fillratio),hoverfillangle:m(f.fillhoverangle,n.hoverFillAngle,f.fillangle),hoverborderthickness:l(f.borderhoverthickness,n.hoverBorderThickness,f.borderthickness),hoverbordercolor:m(f.borderhovercolor,n.hoverBorderColor,f.bordercolor),hoverborderalpha:m(f.borderhoveralpha,n.hoverBorderAlpha,f.borderalpha)});r={alpha:f.fillalpha,color:f.fillcolor,angle:360-f.fillangle,ratio:f.fillratio};p={alpha:f.hoverfillalpha,color:f.hoverfillcolor,angle:360-
f.hoverfillangle,ratio:f.hoverfillratio};f._defaultattrs={fill:v(r),"stroke-width":"0"!==f.showborder?f.borderthickness:0,stroke:C(f.bordercolor,f.borderalpha)};f._hoverattrs={fill:v(p),"stroke-width":"0"!==f.showborder?f.hoverborderthickness:0,stroke:C(f.hoverbordercolor,f.hoverborderalpha)};"image"===f.type&&(f.borderthickness=f.borderthickness||0,f.onload=function(a){var b=this.options,c=a.width;a=a.height;var d=(Number(b.x)-c/(2*g.sFactor))*g.sFactor,b=(Number(b.y)-a/(2*g.sFactor))*g.sFactor,
e;if(c&&a)for(e in{wrapper:1,tracker:1})this[e]&&this[e].attr({x:d,y:b,width:c,height:a})});k.drawOptions.shape=f;if(!n.showLabels)return{markerShape:f};r=f.labelpadding||n.labelPadding;z=a._getLabelOptions(z,r,f);p=z.align;w=z.valign;e=k._labelBaseWidth;H=k._labelBaseHeight;h=k._labelXOffset;E=k._labelYOffset;e=n.labelWrapWidth?n.labelWrapWidth:a.getWrapWidth[p](e,Number(z.x)+h);a=n.labelWrapHeight?n.labelWrapHeight:a.getWrapHeight[w](H,Number(z.y)+E);e>r&&(e-=r);a>r&&(a-=r);k.drawOptions.label=
"center"==p&&"middle"==w?A({type:"text"},{text:q,tooltext:f.tooltext,x:z.x,y:z.y,align:p,valign:z.valign,wrap:1,wrapwidth:e,wrapheight:a,fontsize:d.fontSize/g.sFactor,font:d.fontFamily,fillcolor:d.fontColor,onmouseover:function(){x()},onmouseout:function(){I()}}):A({type:"text"},{text:q,tooltext:f.tooltext,x:z.x,y:z.y,align:p,valign:z.valign,wrap:1,wrapwidth:e,wrapheight:a,fontsize:d.fontSize/g.sFactor,font:d.fontFamily,fillcolor:d.fontColor});return{markerShape:f,markerLabel:k.drawOptions.label}}},
_drawConnectors:function(){var b=this.chart,a=this.components.connectors,c=a.length,d=b.config.scalingParams,e=b.config.connectorOpts,g=e.showLabels,k=b.components.mapAnnotations,f,h=[],l=[],m,s,p,r,q=[];q.push({id:"connectorLabels",fillalpha:"100",items:l});q.push({id:"connectors",fillalpha:"100",items:h});for(f=0;f<c;f++)a[f]&&(s=a[f].config.fromMarker.config,r=a[f].config.toMarker.config,m=s.options.x,s=s.options.y,p=r.options.x,r=r.options.y,a[f].config.x=m,a[f].config.y=s,a[f].config.tox=p,a[f].config.toy=
r,h.push(a[f].config),a[f].labelConfig&&g&&(a[f].labelConfig.x=((Number(m)+Number(p))/2).toString(),a[f].labelConfig.y=((Number(s)+Number(r))/2).toString(),a[f].labelConfig.fontsize=e.fontSize/(d.scaleFactor*b.baseScaleFactor),l.push(a[f].labelConfig)));k.addGroup(q[0]);k.addGroup(q[1])},getShapeArgs:function(){var b=this.config,a=A({},this.shapeObj),c;b.autoScale=1;return a?("polygon"===a.type?3>a.sides?a.type="circle":a.startangle=b.startAngle:"arc"===a.type&&(c=(a.radius||b.markerRadius)*b.autoScale,
a.radius=c,a.innerradius=a.innerradius&&a.innerradius*b.autoScale||.6*c),a):null},_getLabelOptions:function(b,a,c,d,e){var g,k=b&&b.toLowerCase();this.getLabelAlignment[k]||(k="center");b=Number(c.x);g=Number(c.y);c=void 0===d||void 0===e?c.radius||0:/^(top|bottom)$/ig.test(k)&&.5*e||/^(left|right)$/ig.test(k)&&.5*d||0;c=Number(c)+Number(a);return this.getLabelAlignment[k](b,g,c)},getLabelAlignment:{top:function(b,a,c){return{x:b.toString(),y:(a-c).toString(),align:"center",valign:"top"}},left:function(b,
a,c){return{x:(b-c).toString(),y:a.toString(),align:"right",valign:"middle"}},right:function(b,a,c){return{x:(b+c).toString(),y:a.toString(),align:"left",valign:"middle"}},bottom:function(b,a,c){return{x:b.toString(),y:(a+c).toString(),align:"center",valign:"bottom"}},center:function(b,a){return{x:b.toString(),y:a.toString(),align:"center",valign:"middle"}}},getWrapWidth:{right:function(b,a){return a},left:function(b,a){return b-a},center:function(b,a){return 2*E(a,b-a)}},getWrapHeight:{top:function(b,
a){return a},middle:function(b,a){return 2*E(a,b-a)},bottom:function(b,a){return b-a}},addMarkerItem:function(b){var a=this.components.markerObjs,c=this.components.shapeObjs,d=this.components.markerGroup,e=this.components.markerLabelGroup,g,k;if((k=b.id.toLowerCase())&&!a[k]){delete b.value;b=this._initializeMarkerItem(k,b,null);b.dataset=this;if(g=b.config.options.shapeid)b.shapeObj=c[g&&g.toLowerCase()];a[k]=b;a=this._drawMarkerItem.call(b);d&&e&&(b.markerShape=a.markerShape&&d.addItem(a.markerShape,
!0),b.markerLabel=a.markerLabel&&e.addItem(a.markerLabel,!0))}},updateMarkerItem:function(b,a){var c=this.chart.components.mapAnnotations,d,e=this.components.markerObjs[b];e&&(d=e.config.options,A(d,a),d=this._drawMarkerItem.call(e).markerShape,c.update(b,d))},_removeMarkerItem:function(b){var a=this.components.markerObjs,c=a[b],d;c&&(d=c.markerShape,c=c.markerLabel,d&&d.destroy(),c&&c.destroy());delete a[b]}},"Entities"])},[3,2,0,"release"]]);
