text: /*!*********************************************************************
   * ELYCHARTS v2.1.6-SNAPSHOT $Id$ 
   * A Javascript library to generate interactive charts with vectorial graphics.
   *
   * Copyright (c) 2010-2014 Void Labs s.n.c. (http://void.it)
   * Licensed under the MIT (http://creativecommons.org/licenses/MIT/) license.
   **********************************************************************/
  (function(a){if(!a.elycharts){a.elycharts={}}a.elycharts.templates={common:{margins:[10,10,10,10],interactive:true,defaultSeries:{visible:true,tooltip:{active:true,width:100,height:50,roundedCorners:5,padding:[6,6],offset:[20,0],frameProps:{fill:"white","stroke-width":2},contentStyle:{"font-family":"Arial","font-size":"12px","line-height":"16px",color:"black"}},highlight:{scaleSpeed:100,scaleEasing:"",moveSpeed:100,moveEasing:"",restoreSpeed:0,restoreEasing:""},anchor:{},startAnimation:{type:"simple",speed:600,delay:0,propsFrom:{},propsTo:{},easing:""},label:{active:false,html:false,props:{fill:"black",stroke:"none","font-family":"Arial","font-size":"16px"},style:{cursor:"default"}}},series:{empty:{label:{active:false},tooltip:{active:false}}},features:{tooltip:{fadeDelay:100,moveDelay:300},mousearea:{type:"single",indexCenter:"auto",areaMoveDelay:500,syncTag:false,onMouseEnter:false,onMouseExit:false,onMouseChanged:false,onMouseOver:false,onMouseOut:false},highlight:{indexHighlightProps:{opacity:1}},animation:{startAnimation:{speed:600,delay:0,easing:""},stepAnimation:{speed:600,delay:0,easing:""}},frameAnimation:{active:false,cssFrom:{opacity:0},cssTo:{opacity:1},speed:"slow",easing:"linear"},pixelWorkAround:{active:Raphael.svg},label:{},shadows:{active:false,offset:[2,2],props:{"stroke-width":0,"stroke-opacity":0,fill:"black","fill-opacity":0.3}},balloons:{active:false,style:{},padding:[5,5],left:10,line:[[0,0],[0,0]],lineProps:{}},legend:{horizontal:false,x:"auto",y:10,width:"auto",height:20,itemWidth:"fixed",margins:[0,0,0,0],dotMargins:[10,5],borderProps:{fill:"white",stroke:"black","stroke-width":1},dotType:"rect",dotWidth:10,dotHeight:10,dotR:0,dotProps:{type:"rect",width:10,height:10},textProps:{font:"12px Arial",fill:"#000"}},debug:{active:false}},enableInternalCaching:true,nop:0},line:{template:"common",barMargins:0,barOverlapPerc:0,avgOverNulls:true,defaultAxis:{normalize:2,min:0,labels:false,labelsDistance:8,labelsRotate:0,labelsProps:{font:"10px Arial",fill:"#000"},titleDistance:25,titleDistanceIE:0.75,titleProps:{font:"12px Arial",fill:"#000","font-weight":"bold"}},axis:{x:{titleDistanceIE:1.2}},defaultSeries:{type:"line",axis:"l",cumulative:false,rounded:1,lineCenter:"auto",plotProps:{"stroke-width":1,"stroke-linejoin":"round"},barWidthPerc:100,fill:false,fillProps:{stroke:"none","stroke-width":0,"stroke-opacity":0,opacity:0.3},dot:false,dotProps:{size:4,stroke:"#000",zindex:5},dotShowOnNull:false,mouseareaShowOnNull:false,startAnimation:{plotPropsFrom:false,fillPropsFrom:false,dotPropsFrom:false,shadowPropsFrom:false}},features:{grid:{nx:"auto",ny:4,draw:false,forceBorder:false,props:{stroke:"#e0e0e0","stroke-width":1},extra:[0,0,0,0],labelsCenter:"auto",evenVProps:false,oddVProps:false,evenHProps:false,oddHProps:false,ticks:{active:[false,false,false],size:[10,10],props:{stroke:"#e0e0e0","stroke-width":1}}}},nop:0},pie:{template:"common",startAngle:0,clockwise:false,valueThresold:0.006,margins:[0,0,0,0],defaultSeries:{}},funnel:{template:"common",rh:0,method:"width",topSector:0,topSectorProps:{fill:"#d0d0d0"},bottomSector:0.1,bottomSectorProps:{fill:"#d0d0d0"},edgeProps:{fill:"#c0c0c0","stroke-width":1,opacity:1},nop:0},barline:{template:"common",direction:"ltr"}}})(jQuery);(function(c){if(!c.elycharts){c.elycharts={}}c.elycharts.lastId=0;c.fn.chart=function(j){if(!this.length){return this}var n=this.data("elycharts_env");if(typeof j=="string"){if(j.toLowerCase()=="config"){return n?n.opt:false}if(j.toLowerCase()=="clear"){if(n){if(c.elycharts.featuresmanager){c.elycharts.featuresmanager.clear(n)}n.paper.clear();n.cache=false;if(n.autoresize){c(window).unbind("resize",n.autoresize)}this.html("");this.data("elycharts_env",false)}}return this}if(!n){if(j){j=d(j)}if(!j||!j.type||!c.elycharts.templates[j.type]){alert("ElyCharts ERROR: chart type is not specified");return false}n=i(this,j);this.data("elycharts_env",n)}else{if(!j){j={}}j=b(j,n.opt);n.oldopt=f._clone(n.opt);n.opt=c.extend(true,n.opt,j);n.newopt=j;n.oldwidth=n.width;n.oldheight=n.height}n.cache=j.enableInternalCaching?{}:false;e(n,j);if(n.opt.autoresize){if(!n.autoresize){var m=this;n.autoresize=h(function(){m.chart()});c(window).bind("resize",n.autoresize)}}else{if(n.autoresize){c(window).unbind("resize",n.autoresize);n.autoresize=false}}var l=c.elycharts[n.opt.type].draw(n);if(n.pieces){l=g(n,n.pieces,l)}f._show(n,l);n.pieces=l;return this};function g(t,m,l,u,r,q){var o=[],s;var n=0;for(var p=0;p<m.length;p++){if(l&&(n>=l.length||!f.samePiecePath(m[p],l[n]))){if(!q){m[p].show=false;o.push(m[p])}else{s={path:false,attr:false};s.show=true;s.animation={element:m[p].element?m[p].element:false,speed:0,easing:"",delay:0};o.push(s)}}else{s=l?l[n]:{path:false,attr:false};s.show=true;if(typeof m[p].paths=="undefined"){s.animation={element:m[p].element?m[p].element:false,speed:0,easing:"",delay:0}}else{s.paths=g(t,m[p].paths,l[n].paths,m[p].section,m[p].serie,true)}o.push(s);n++}}if(l){for(;n<l.length;n++){o.push(l[n])}}return o}function h(n,j,l){var o;return function m(){var r=this,q=arguments;function p(){if(!l){n.apply(r,q)}o=null}if(o){clearTimeout(o)}else{if(l){n.apply(r,q)}}o=setTimeout(p,j||100)}}function i(m,j){var l={id:c.elycharts.lastId++,paper:f._RaphaelInstance(m.get()[0],0,0),container:m,plots:[],opt:j};l.paper.rect(0,0,1,1).attr({opacity:0});c.elycharts[j.type].init(l);return l}function e(l,j){if(j.style){l.container.css(j.style)}l.width=j.width?j.width:l.container.width();l.height=j.height?j.height:l.container.height();l.paper.setSize(l.width,l.height)}function d(j){var l;if(c.elysia_charts){if(c.elysia_charts.default_options){for(l in c.elysia_charts.default_options){c.elycharts.templates[l]=c.elysia_charts.default_options[l]}}if(c.elysia_charts.templates){for(l in c.elysia_charts.templates){c.elycharts.templates[l]=c.elysia_charts.templates[l]}}}while(j.template){var m=j.template;delete j.template;j=c.extend(true,{},c.elycharts.templates[m],j)}if(!j.template&&j.type){j.template=j.type;while(j.template){m=j.template;delete j.template;j=c.extend(true,{},c.elycharts.templates[m],j)}}return b(j,j)}function b(j,l){if(j.type=="pie"||j.type=="funnel"){if(j.values&&c.isArray(j.values)&&!c.isArray(j.values[0])){j.values={root:j.values}}if(j.tooltips&&c.isArray(j.tooltips)&&!c.isArray(j.tooltips[0])){j.tooltips={root:j.tooltips}}if(j.anchors&&c.isArray(j.anchors)&&!c.isArray(j.anchors[0])){j.anchors={root:j.anchors}}if(j.balloons&&c.isArray(j.balloons)&&!c.isArray(j.balloons[0])){j.balloons={root:j.balloons}}if(j.legend&&c.isArray(j.legend)&&!c.isArray(j.legend[0])){j.legend={root:j.legend}}}if(j.defaultSeries){var o=j.defaultSeries.type?j.defaultSeries.type:(l.defaultSeries.type?l.defaultSeries.type:l.type);a(j.defaultSeries,l.type,o,l)}if(j.series){for(var n in j.series){var p=j.series[n].type?j.series[n].type:(l.series[n].type?l.series[n].type:(o?o:l.type));a(j.series[n],l.type,p,l)}}if(j.type=="line"){if(!j.features){j.features={}}if(!j.features.grid){j.features.grid={}}if(typeof j.gridNX!="undefined"){j.features.grid.nx=j.gridNX;delete j.gridNX}if(typeof j.gridNY!="undefined"){j.features.grid.ny=j.gridNY;delete j.gridNY}if(typeof j.gridProps!="undefined"){j.features.grid.props=j.gridProps;delete j.gridProps}if(typeof j.gridExtra!="undefined"){j.features.grid.extra=j.gridExtra;delete j.gridExtra}if(typeof j.gridForceBorder!="undefined"){j.features.grid.forceBorder=j.gridForceBorder;delete j.gridForceBorder}if(j.defaultAxis&&j.defaultAxis.normalize&&(j.defaultAxis.normalize=="auto"||j.defaultAxis.normalize=="autony")){j.defaultAxis.normalize=2}if(j.axis){for(var m in j.axis){if(j.axis[m]&&j.axis[m].normalize&&(j.axis[m].normalize=="auto"||j.axis[m].normalize=="autony")){j.axis[m].normalize=2}}}}return j}function a(n,j,l,m){if(n.stackedWith){n.stacked=n.stackedWith;delete n.stackedWith}}c.elycharts.common={_RaphaelInstance:function(n,j,l){var m=Raphael(n,j,l);m.customAttributes.slice=function(o,v,s,q,u,t){a1=360-t;a2=360-u;var p=(a2-a1)>180;a1=(a1%360)*Math.PI/180;a2=(a2%360)*Math.PI/180;if(a1==a2&&u!=t){a2+=359.99*Math.PI/180}return{path:q?[["M",o+s*Math.cos(a1),v+s*Math.sin(a1)],["A",s,s,0,+p,1,o+s*Math.cos(a2),v+s*Math.sin(a2)],["L",o+q*Math.cos(a2),v+q*Math.sin(a2)],["A",q,q,0,+p,0,o+q*Math.cos(a1),v+q*Math.sin(a1)],["z"]]:[["M",o,v],["l",s*Math.cos(a1),s*Math.sin(a1)],["A",s,s,0,+p,1,o+s*Math.cos(a2),v+s*Math.sin(a2)],["z"]]}};return m},_clone:function(m){if(m==null||typeof(m)!="object"){return m}if(m.constructor==Array){return[].concat(m)}var j=new m.constructor();for(var l in m){j[l]=this._clone(m[l])}return j},compactUnits:function(n,l){for(var m=l.length-1;m>=0;m--){var j=n/Math.pow(1000,m+1);if(j>=1&&j*10%10==0){return j+l[m]}}return n},getElementOriginalAttrs:function(l){var j=c(l.node).data("original-attr");if(!j){j=l.attr();c(l.node).data("original-attr",j)}return j},findInPieces:function(n,p,m,j,o){for(var l=0;l<n.length;l++){if((typeof p==undefined||p==-1||p==false||n[l].section==p)&&(typeof m==undefined||m==-1||m==false||n[l].serie==m)&&(typeof j==undefined||j==-1||j==false||n[l].index==j)&&(typeof o==undefined||o==-1||o==false||n[l].subSection==o)){return n[l]}}return false},samePiecePath:function(l,j){return(((typeof l.section==undefined||l.section==-1||l.section==false)&&(typeof j.section==undefined||j.section==-1||j.section==false))||l.section==j.section)&&(((typeof l.serie==undefined||l.serie==-1||l.serie==false)&&(typeof j.serie==undefined||j.serie==-1||j.serie==false))||l.serie==j.serie)&&(((typeof l.index==undefined||l.index==-1||l.index==false)&&(typeof j.index==undefined||j.index==-1||j.index==false))||l.index==j.index)&&(((typeof l.subSection==undefined||l.subSection==-1||l.subSection==false)&&(typeof j.subSection==undefined||j.subSection==-1||j.subSection==false))||l.subSection==j.subSection)},executeIfChanged:function(o,n){if(!o.newopt){return true}for(var m=0;m<n.length;m++){if(n[m][n[m].length-1]=="*"){for(var l in o.newopt){if(l.substring(0,n[m].length-1)+"*"==n[m]){return true}}}else{if(n[m]=="series"&&(o.newopt.series||o.newopt.defaultSeries)){return true}else{if(n[m]=="axis"&&(o.newopt.axis||o.newopt.defaultAxis)){return true}else{if(n[m]=="width"&&(o.oldwidth!=o.width)){return true}else{if(n[m]=="height"&&(o.oldheight!=o.height)){return true}else{if(n[m].substring(0,9)=="features."){n[m]=n[m].substring(9);if(o.newopt.features&&o.newopt.features[n[m]]){return true}}else{if(typeof o.newopt[n[m]]!="undefined"){return true}}}}}}}}return false},getItemColor:function(n,o,l){var m=this.areaProps(n,"Series",o,l);if(m.color){return m.color}if(l!==false&&m.valuesPalette){return m.valuesPalette[l%m.valuesPalette.length]}if(n.opt.seriesPalette){var j=0;for(seriekey in n.opt.values){if(o==seriekey){return n.opt.seriesPalette[j%n.opt.seriesPalette.length]}else{j++}}}},colorize:function(o,n,l,j){if(j){for(k in l){var q=n;var m=0;for(m=0;m<l[k].length-1;m++){if(!q[l[k][m]]){q[l[k][m]]={}}q=q[l[k][m]]}if(!q[l[k][l[k].length-1]]){q[l[k][l[k].length-1]]=j}}}},areaProps:function(m,r,l,n,j){var q;var s=m.opt[r.toLowerCase()];if(!j){if(typeof l=="undefined"||!l){q=s}else{var o=r+"/"+l+"/"+n;if(m.cache&&m.cache.areaPropsCache&&m.cache.areaPropsCache[o]){q=m.cache.areaPropsCache[o]}else{q=this._clone(m.opt["default"+r]);if(s&&s[l]){q=c.extend(true,q,s[l])}if((typeof n!="undefined")&&n>=0&&q.values&&q.values[n]){q=c.extend(true,q,q.values[n])}if(m.cache){if(!m.cache.areaPropsCache){m.cache.areaPropsCache={}}m.cache.areaPropsCache[o]=q}}}}else{var p=j.toLowerCase();q=this._clone(m.opt[p]);if(typeof l=="undefined"||!l){if(s&&s[p]){q=c.extend(true,q,s[p])}}else{if(m.opt["default"+r]&&m.opt["default"+r][p]){q=c.extend(true,q,m.opt["default"+r][p])}if(s&&s[l]&&s[l][p]){q=c.extend(true,q,s[l][p])}if((typeof n!="undefined")&&n>0&&q.values&&q.values[n]){q=c.extend(true,q,q.values[n])}}}return q},_absrectpath:function(l,o,j,n,p){if(p){var m=[["M",l,o+p],["a",p,p,0,0,1,p,-p],["L",j-p,o],["a",p,p,0,0,1,p,p],["L",j,n-p],["a",p,p,0,0,1,-p,p],["L",l+p,n],["a",p,p,0,0,1,-p,-p],["z"]];return m}else{return[["M",l,o],["L",l,n],["L",j,n],["L",j,o],["z"]]}},_linepathAnchors:function(m,l,x,v,s,r,o){var j=1;if(o&&o.length){j=o[1];o=o[0]}if(!o){o=1}var p=(x-m)/2,n=(s-x)/2,y=Math.atan(Math.abs(x-m)/Math.abs(v-l)),w=Math.atan(Math.abs(s-x)/Math.abs(v-r));y=(l<v&&x>m)||(l>v&&x<m)?Math.PI-y:y;w=(r<v&&s>x)||(r>v&&s<x)?Math.PI-w:w;if(j==2){if((y-Math.PI/2)*(w-Math.PI/2)>0){y=0;w=0}else{if(Math.abs(y-Math.PI/2)<Math.abs(w-Math.PI/2)){w=Math.PI-y}else{y=Math.PI-w}}}var q=Math.PI/2-((y+w)%(Math.PI*2))/2,A=p*Math.sin(q+y)/2/o,u=p*Math.cos(q+y)/2/o,z=n*Math.sin(q+w)/2/o,t=n*Math.cos(q+w)/2/o;return{x1:x-A,y1:v+u,x2:x+z,y2:v+t}},_linepath:function(v,n){var w=[];if(n){var q=false;for(var o=0,r=v.length;o<r;o++){var u=v[o][0],s=v[o][1];if(u!=null&&s!=null){if(q){if(o+1!=r&&v[o+1][0]!=null&&v[o+1][1]!=null){var t=this._linepathAnchors(v[o-1][0],v[o-1][1],v[o][0],v[o][1],v[o+1][0],v[o+1][1],n);w.push(["C",q[0],q[1],t.x1,t.y1,v[o][0],v[o][1]]);q=[t.x2,t.y2]}else{w.push(["C",q[0],q[1],v[o][0],v[o][1],v[o][0],v[o][1]]);q=[v[o][0],v[o][1]]}}else{w.push(["M",v[o][0],v[o][1]]);q=[v[o][0],v[o][1]]}}else{q=false}}}else{var m=null;var l=null;for(var p=0;p<v.length;p++){var u=v[p][0],s=v[p][1];if(u!=null&&s!=null){w.push([m==null||l==null?"M":"L",u,s])}m=u;l=s}}return w},_lineareapath:function(t,r,l){var s=this._linepath(t,l);var q=this._linepath(r.reverse(),l);var p=[];var o=null;for(var n=0;n<=s.length;n++){if(n==s.length||s[n][0]=="M"){if(o!=null){for(var m=s.length-n;m<=s.length-o;m++){if(q[m][0]=="M"){p.push(["L",q[m][1],q[m][2]])}else{p.push(q[m])}}p.push(["z"]);o=null}if(n!=s.length){p.push(s[n])}}else{p.push(s[n]);if(o==null){o=n}}}return p},getX:function(j,l){switch(j[0]){case"CIRCLE":return j[1];case"RECT":return j[!l?1:3];case"SLICE":return j[1];default:return j[j.length-2]}},getY:function(j,l){switch(j[0]){case"CIRCLE":return j[2];case"RECT":return j[!l?2:4];case"SLICE":return j[2];default:return j[j.length-1]}},getCenter:function(n,o){if(!n.path){return false}if(n.path.length==0){return false}if(!o){o=[0,0]}if(n.center){return[n.center[0]+o[0],n.center[1]+o[1]]}var m=n.path[0];switch(m[0]){case"CIRCLE":return[m[1]+o[0],m[2]+o[1]];case"RECT":return[(m[1]+m[2])/2+o[0],(m[3]+m[4])/2+o[1]];case"SLICE":var l=m[5]+(m[6]-m[5])/2;var j=Math.PI/180;return[m[1]+(m[4]+((m[3]-m[4])/2)+o[0])*Math.cos(-l*j)+o[1]*Math.cos((-l-90)*j),m[2]+(m[4]+((m[3]-m[4])/2)+o[0])*Math.sin(-l*j)+o[1]*Math.sin((-l-90)*j)]}alert("ElyCharts: getCenter with complex path not supported");return false},movePath:function(w,D,u,s,l){var m=[],v;if(D.length==1&&D[0][0]=="RECT"){return[[D[0][0],this._movePathX(w,D[0][1],u[0],s),this._movePathY(w,D[0][2],u[1],s),this._movePathX(w,D[0][3],u[0],s),this._movePathY(w,D[0][4],u[1],s),D[0][5]]]}if(D.length==1&&D[0][0]=="SLICE"){if(!l){var C=D[0][5]+(D[0][6]-D[0][5])/2;var z=Math.PI/180;var B=D[0][1]+u[0]*Math.cos(-C*z)+u[1]*Math.cos((-C-90)*z);var A=D[0][2]+u[0]*Math.sin(-C*z)+u[1]*Math.cos((-C-90)*z);return[[D[0][0],B,A,D[0][3],D[0][4],D[0][5],D[0][6]]]}else{return[[D[0][0],D[0][1]+u[0],D[0][2]+u[1],D[0][3],D[0][4],D[0][5],D[0][6]]]}}if(D.length==1&&D[0][0]=="CIRCLE"){return[[D[0][0],D[0][1]+u[0],D[0][2]+u[1],D[0][3]]]}if(D.length==1&&D[0][0]=="TEXT"){return[[D[0][0],D[0][1],D[0][2]+u[0],D[0][3]+u[1]]]}if(D.length==1&&D[0][0]=="LINE"){for(v=0;v<D[0][1].length;v++){m.push([this._movePathX(w,D[0][1][v][0],u[0],s),this._movePathY(w,D[0][1][v][1],u[1],s)])}return[[D[0][0],m,D[0][2]]]}if(D.length==1&&D[0][0]=="LINEAREA"){for(v=0;v<D[0][1].length;v++){m.push([this._movePathX(w,D[0][1][v][0],u[0],s),this._movePathY(w,D[0][1][v][1],u[1],s)])}var q=[];for(v=0;v<D[0][2].length;v++){q.push([this._movePathX(w,D[0][2][v][0],u[0],s),this._movePathY(w,D[0][2][v][1],u[1],s)])}return[[D[0][0],m,q,D[0][3]]]}var r=[];for(var t=0;t<D.length;t++){var n=D[t];switch(n[0]){case"M":case"m":case"L":case"l":case"T":case"t":r.push([n[0],this._movePathX(w,n[1],u[0],s),this._movePathY(w,n[2],u[1],s)]);break;case"A":case"a":r.push([n[0],n[1],n[2],n[3],n[4],n[5],this._movePathX(w,n[6],u[0],s),this._movePathY(w,n[7],u[1],s)]);break;case"C":case"c":r.push([n[0],this._movePathX(w,n[1],u[0],s),this._movePathY(w,n[2],u[1],s),this._movePathX(w,n[3],u[0],s),this._movePathY(w,n[4],u[1],s),this._movePathX(w,n[5],u[0],s),this._movePathY(w,n[6],u[1],s)]);break;case"S":case"s":case"Q":case"q":r.push([n[0],this._movePathX(w,n[1],u[0],s),this._movePathY(w,n[2],u[1],s),this._movePathX(w,n[3],u[0],s),this._movePathY(w,n[4],u[1],s)]);break;case"z":case"Z":r.push([n[0]]);break}}return r},_movePathX:function(m,j,l,n){if(j==null){return null}if(!n){return j+l}j=j+l;return l>0&&j>m.width-m.opt.margins[1]?m.width-m.opt.margins[1]:(l<0&&j<m.opt.margins[3]?m.opt.margins[3]:j)},_movePathY:function(l,n,j,m){if(n==null){return null}if(!m){return n+j}n=n+j;return j>0&&n>l.height-l.opt.margins[2]?l.height-l.opt.margins[2]:(j<0&&n<l.opt.margins[0]?l.opt.margins[0]:n)},getSVGProps:function(n,q,j){var p=this._preparePathShow(n,q);var m=j?j:{};var l="path",o;if(p.length==1&&p[0][0]=="RECT"){o=f._absrectpath(p[0][1],p[0][2],p[0][3],p[0][4],p[0][5])}else{if(p.length==1&&p[0][0]=="SLICE"){l="slice";o=[p[0][1],p[0][2],p[0][3],p[0][4],p[0][5],p[0][6]]}else{if(p.length==1&&p[0][0]=="LINE"){o=f._linepath(p[0][1],p[0][2])}else{if(p.length==1&&p[0][0]=="LINEAREA"){o=f._lineareapath(p[0][1],p[0][2],p[0][3])}else{if(p.length==1&&(p[0][0]=="CIRCLE"||p[0][0]=="TEXT"||p[0][0]=="DOMELEMENT"||p[0][0]=="RELEMENT")){return j?j:false}else{o=p}}}}}if(l!="path"||(o&&o.length>0)){m[l]=o}else{if(!j){return false}}return m},showPath:function(n,o,p){if(!p){p=n.paper}if(o.length==1&&o[0][0]=="CIRCLE"){o=this._preparePathShow(n,o);return p.circle(o[0][1],o[0][2],o[0][3])}if(o.length==1&&o[0][0]=="TEXT"){o=this._preparePathShow(n,o);return p.text(o[0][2],o[0][3],o[0][1])}var m=this.getSVGProps(n,o);var l=false;for(var j in m){l=true;break}return m&&l?p.path().attr(m):false},_preparePathShow:function(j,l){return j.opt.features.pixelWorkAround.active?this.movePath(j,this._clone(l),[0.5,0.5],false,true):l},getPieceFullAttr:function(l,j){if(!j.fullattr){j.fullattr=this._clone(j.attr);if(j.path){switch(j.path[0][0]){case"CIRCLE":var m=this._preparePathShow(l,j.path);j.fullattr.cx=m[0][1];j.fullattr.cy=m[0][2];j.fullattr.r=m[0][3];break;case"TEXT":case"DOMELEMENT":case"RELEMENT":break;default:j.fullattr=this.getSVGProps(l,j.path,j.fullattr)}}if(typeof j.fullattr.opacity=="undefined"){j.fullattr.opacity=1}}return j.fullattr},_show:function(o,m){if(c.elycharts.featuresmanager){c.elycharts.featuresmanager.beforeShow(o,m)}pieces=this._getSortedPathData(m);this._animationStackStart(o);var j=false;for(var l=0;l<pieces.length;l++){var n=pieces[l];if((typeof n.show=="undefined"||n.show)&&(typeof n.parent=="undefined"||typeof n.parent.show=="undefined"||n.parent.show)){n.element=n.animation&&n.animation.element?n.animation.element:false;n.hide=false;if(!n.path){n.hide=true}else{if(n.path.length==1&&n.path[0][0]=="TEXT"){if(n.element){f.animationStackPush(o,n,n.element,false,n.animation.speed,n.animation.easing,n.animation.delay,true);n.animation.element=false}n.element=this.showPath(o,n.path);if(n.element&&o.newopt&&j){n.element.insertAfter(j)}}else{if(n.path.length==1&&n.path[0][0]=="DOMELEMENT"){}else{if(n.path.length==1&&n.path[0][0]=="RELEMENT"){if(n.element){f.animationStackPush(o,n,n.element,false,n.animation.speed,n.animation.easing,n.animation.delay,true);n.animation.element=false}n.element=n.path[0][1];if(n.element&&j){n.element.insertAfter(j)}n.attr=false}else{if(!n.element){if(n.animation&&n.animation.startPath&&n.animation.startPath.length){n.element=this.showPath(o,n.animation.startPath)}else{n.element=this.showPath(o,n.path)}if(n.element&&o.newopt&&j){n.element.insertAfter(j)}}}}}}if(n.element){if(n.attr){if(!n.animation){if(typeof n.attr.opacity=="undefined"){n.attr.opacity=1}n.element.attr(n.attr)}else{if(!n.animation.element){n.element.attr(n.animation.startAttr?n.animation.startAttr:n.attr)}f.animationStackPush(o,n,n.element,this.getPieceFullAttr(o,n),n.animation.speed,n.animation.easing,n.animation.delay)}}else{if(n.hide){f.animationStackPush(o,n,n.element,false,n.animation.speed,n.animation.easing,n.animation.delay)}}j=n.element}}}this._animationStackEnd(o);if(c.elycharts.featuresmanager){c.elycharts.featuresmanager.afterShow(o,m)}},_getSortedPathData:function(o){res=[];for(var m=0;m<o.length;m++){var n=o[m];if(n.paths){for(var l=0;l<n.paths.length;l++){n.paths[l].pos=res.length;n.paths[l].parent=n;res.push(n.paths[l])}}else{n.pos=res.length;n.parent=false;res.push(n)}}return res.sort(function(p,j){var r=typeof p.attr=="undefined"||typeof p.attr.zindex=="undefined"?(!p.parent||typeof p.parent.attr=="undefined"||typeof p.parent.attr.zindex=="undefined"?0:p.parent.attr.zindex):p.attr.zindex;var q=typeof j.attr=="undefined"||typeof j.attr.zindex=="undefined"?(!j.parent||typeof j.parent.attr=="undefined"||typeof j.parent.attr.zindex=="undefined"?0:j.parent.attr.zindex):j.attr.zindex;return r<q?-1:(r>q?1:(p.pos<j.pos?-1:(p.pos>j.pos?1:0)))})},_animationStackStart:function(j){if(!j.animationStackDepth||j.animationStackDepth==0){j.animationStackDepth=0;j.animationStack={}}j.animationStackDepth++},_animationStackEnd:function(l){l.animationStackDepth--;if(l.animationStackDepth==0){for(var j in l.animationStack){this._animationStackAnimate(l.animationStack[j],j);delete l.animationStack[j]}l.animationStack={}}},animationStackPush:function(o,n,m,j,q,r,l,p){if(typeof l=="undefined"){l=0}if(!o.animationStackDepth||o.animationStackDepth==0){this._animationStackAnimate([{piece:n,object:m,props:j,speed:q,easing:r,force:p}],l)}else{if(!o.animationStack[l]){o.animationStack[l]=[]}o.animationStack[l].push({piece:n,object:m,props:j,speed:q,easing:r,force:p})}},_animationStackAnimate:function(j,m){var l=this;var n=function(){var p=j.pop();var q=l._animationStackAnimateElement(p);while(j.length>0){var o=j.pop();l._animationStackAnimateElement(o,p,q)}};if(m>0){setTimeout(n,m)}else{n()}},_animationStackAnimateElement:function(j,o,n){if(j.force||!j.piece.animationInProgress){j.object.stop();if(!j.props){j.props={opacity:0}}if(!j.speed||j.speed<=0){j.object.attr(j.props);j.piece.animationInProgress=false;return}j.piece.animationInProgress=true;var l=function(){j.piece.animationInProgress=false};if(Raphael.animation){var m=Raphael.animation(j.props,j.speed,j.easing?j.easing:"linear",l);if(o){j.object.animateWith(o,n,m)}else{j.object.animate(m)}return m}else{if(o){j.object.animateWith(o,j.props,j.speed,j.easing?j.easing:"linear",l)}else{j.object.animate(j.props,j.speed,j.easing?j.easing:"linear",l)}return null}}return null}};var f=c.elycharts.common;c.elycharts.featuresmanager={managers:[],initialized:false,register:function(l,j){c.elycharts.featuresmanager.managers.push([j,l]);c.elycharts.featuresmanager.initialized=false},init:function(){c.elycharts.featuresmanager.managers.sort(function(l,j){return l[0]<j[0]?-1:(l[0]==j[0]?0:1)});c.elycharts.featuresmanager.initialized=true},clear:function(l){if(!c.elycharts.featuresmanager.initialized){this.init()}for(var j=c.elycharts.featuresmanager.managers.length-1;j>=0;j--){if(c.elycharts.featuresmanager.managers[j][1].clear){c.elycharts.featuresmanager.managers[j][1].clear(l)}}},beforeShow:function(l,m){if(!c.elycharts.featuresmanager.initialized){this.init()}for(var j=0;j<c.elycharts.featuresmanager.managers.length;j++){if(c.elycharts.featuresmanager.managers[j][1].beforeShow){c.elycharts.featuresmanager.managers[j][1].beforeShow(l,m)}}},afterShow:function(l,m){if(!c.elycharts.featuresmanager.initialized){this.init()}for(var j=0;j<c.elycharts.featuresmanager.managers.length;j++){if(c.elycharts.featuresmanager.managers[j][1].afterShow){c.elycharts.featuresmanager.managers[j][1].afterShow(l,m)}}},onMouseOver:function(n,o,l,j){if(!c.elycharts.featuresmanager.initialized){this.init()}for(var m=0;m<c.elycharts.featuresmanager.managers.length;m++){if(c.elycharts.featuresmanager.managers[m][1].onMouseOver){c.elycharts.featuresmanager.managers[m][1].onMouseOver(n,o,l,j)}}},onMouseOut:function(n,o,l,j){if(!c.elycharts.featuresmanager.initialized){this.init()}for(var m=0;m<c.elycharts.featuresmanager.managers.length;m++){if(c.elycharts.featuresmanager.managers[m][1].onMouseOut){c.elycharts.featuresmanager.managers[m][1].onMouseOut(n,o,l,j)}}},onMouseEnter:function(n,o,l,j){if(!c.elycharts.featuresmanager.initialized){this.init()}for(var m=0;m<c.elycharts.featuresmanager.managers.length;m++){if(c.elycharts.featuresmanager.managers[m][1].onMouseEnter){c.elycharts.featuresmanager.managers[m][1].onMouseEnter(n,o,l,j)}}},onMouseChanged:function(n,o,l,j){if(!c.elycharts.featuresmanager.initialized){this.init()}for(var m=0;m<c.elycharts.featuresmanager.managers.length;m++){if(c.elycharts.featuresmanager.managers[m][1].onMouseChanged){c.elycharts.featuresmanager.managers[m][1].onMouseChanged(n,o,l,j)}}},onMouseExit:function(n,o,l,j){if(!c.elycharts.featuresmanager.initialized){this.init()}for(var m=0;m<c.elycharts.featuresmanager.managers.length;m++){if(c.elycharts.featuresmanager.managers[m][1].onMouseExit){c.elycharts.featuresmanager.managers[m][1].onMouseExit(n,o,l,j)}}}}})(jQuery);(function(b){var a=b.elycharts.common;b.elycharts.anchormanager={afterShow:function(e,g){if(!e.opt.anchors){return}if(!e.anchorBinds){e.anchorBinds=[]}while(e.anchorBinds.length){var c=e.anchorBinds.pop();b(c[0]).unbind(c[1],c[2])}for(var d=0;d<e.mouseAreas.length;d++){var f=e.mouseAreas[d].piece?e.mouseAreas[d].piece.serie:false;var h;if(f){h=e.opt.anchors[f][e.mouseAreas[d].index]}else{h=e.opt.anchors[e.mouseAreas[d].index]}if(h&&e.mouseAreas[d].props.anchor&&e.mouseAreas[d].props.anchor.highlight){(function(m,j,n,l){var i=function(){l.anchorMouseOver(m,j)};var o=function(){l.anchorMouseOut(m,j)};if(!m.mouseAreas[d].props.anchor.useMouseEnter){m.anchorBinds.push([n,"mouseover",i]);m.anchorBinds.push([n,"mouseout",o]);b(n).mouseover(i);b(n).mouseout(o)}else{m.anchorBinds.push([n,"mouseenter",i]);m.anchorBinds.push([n,"mouseleave",o]);b(n).mouseenter(i);b(n).mouseleave(o)}})(e,e.mouseAreas[d],h,this)}}e.onAnchors=[]},anchorMouseOver:function(d,c){b.elycharts.highlightmanager.onMouseOver(d,c.piece?c.piece.serie:false,c.index,c)},anchorMouseOut:function(d,c){b.elycharts.highlightmanager.onMouseOut(d,c.piece?c.piece.serie:false,c.index,c)},onMouseOver:function(e,f,d,c){if(!e.opt.anchors){return}if(c.props.anchor&&c.props.anchor.addClass){var g;if(f){g=e.opt.anchors[f][c.index]}else{g=e.opt.anchors[c.index]}if(g){b(g).addClass(c.props.anchor.addClass);e.onAnchors.push([g,c.props.anchor.addClass])}}},onMouseOut:function(e,f,d,c){if(!e.opt.anchors){return}while(e.onAnchors.length>0){var g=e.onAnchors.pop();b(g[0]).removeClass(g[1])}}};b.elycharts.featuresmanager.register(b.elycharts.anchormanager,30)})(jQuery);(function(b){var a=b.elycharts.common;b.elycharts.animationmanager={beforeShow:function(c,d){if(!c.newopt){this.startAnimation(c,d)}else{this.stepAnimation(c,d)}},stepAnimation:function(c,d){d=this._stepAnimationInt(c,d)},_stepAnimationInt:function(e,h,j,g,c){for(var d=0;d<h.length;d++){var f=a.areaProps(e,j?j:h[d].section,g?g:h[d].serie);if(f&&f.stepAnimation){f=f.stepAnimation}else{f=e.opt.features.animation.stepAnimation}if(typeof h[d].paths=="undefined"){if(f&&f.active&&h[d].animation){h[d].animation.speed=f&&f.speed?f.speed:300;h[d].animation.easing=f&&f.easing?f.easing:"";h[d].animation.delay=f&&f.delay?f.delay:0;if(!h[d].animation.element){h[d].animation.startAttr={opacity:0}}}}else{this._stepAnimationInt(e,h[d].paths,h[d].section,h[d].serie,true)}}},startAnimation:function(e,f){for(var c=0;c<f.length;c++){if(f[c].paths||f[c].path){var d=a.areaProps(e,f[c].section,f[c].serie);if(d&&d.startAnimation){d=d.startAnimation}else{d=e.opt.features.animation.startAnimation}if(d&&d.active){if(d.type=="simple"||f[c].section!="Series"){this.animationSimple(e,d,f[c])}if(d.type=="grow"){this.animationGrow(e,d,f[c])}if(d.type=="avg"){this.animationAvg(e,d,f[c])}if(d.type=="reg"){this.animationReg(e,d,f[c])}}}}},_animationPiece:function(d,f,e){if(d.paths){for(var c=0;c<d.paths.length;c++){this._animationPiece(d.paths[c],f,e)}}else{if(d.path){d.animation={speed:f.speed,easing:f.easing,delay:f.delay,startPath:[],startAttr:a._clone(d.attr)};if(f.propsTo){d.attr=b.extend(true,d.attr,f.propsTo)}if(f.propsFrom){d.animation.startAttr=b.extend(true,d.animation.startAttr,f.propsFrom)}if(e&&f[e.toLowerCase()+"PropsFrom"]){d.animation.startAttr=b.extend(true,d.animation.startAttr,f[e.toLowerCase()+"PropsFrom"])}if(typeof d.animation.startAttr.opacity!="undefined"&&typeof d.attr.opacity=="undefined"){d.attr.opacity=1}}}},animationSimple:function(e,d,c){this._animationPiece(c,d,c.subSection)},animationGrow:function(g,f,e){this._animationPiece(e,f,e.subSection);var d,h,j;switch(g.opt.type){case"line":j=g.height-g.opt.margins[2];switch(e.subSection){case"Plot":if(!e.paths){h=["LINE",[],e.path[0][2]];for(d=0;d<e.path[0][1].length;d++){h[1].push([e.path[0][1][d][0],e.path[0][1][d][1]==null?null:j])}e.animation.startPath.push(h)}else{for(d=0;d<e.paths.length;d++){if(e.paths[d].path){e.paths[d].animation.startPath.push(["RECT",e.paths[d].path[0][1],j,e.paths[d].path[0][3],j])}}}break;case"Fill":h=["LINEAREA",[],[],e.path[0][3]];for(d=0;d<e.path[0][1].length;d++){h[1].push([e.path[0][1][d][0],e.path[0][1][d][1]==null?null:j]);h[2].push([e.path[0][2][d][0],e.path[0][2][d][1]==null?null:j])}e.animation.startPath.push(h);break;case"Dot":for(d=0;d<e.paths.length;d++){if(e.paths[d].path){e.paths[d].animation.startPath.push(["CIRCLE",e.paths[d].path[0][1],j,e.paths[d].path[0][3]])}}break}break;case"pie":if(e.subSection=="Plot"){for(d=0;d<e.paths.length;d++){if(e.paths[d].path&&e.paths[d].path[0][0]=="SLICE"){e.paths[d].animation.startPath.push(["SLICE",e.paths[d].path[0][1],e.paths[d].path[0][2],e.paths[d].path[0][4]+e.paths[d].path[0][3]*0.1,e.paths[d].path[0][4],e.paths[d].path[0][5],e.paths[d].path[0][6]])}}}break;case"funnel":alert("Unsupported animation GROW for funnel");break;case"barline":var c;if(e.section=="Series"&&e.subSection=="Plot"){if(!f.subType){c=g.opt.direction!="rtl"?g.opt.margins[3]:g.width-g.opt.margins[1]}else{if(f.subType==1){c=g.opt.direction!="rtl"?g.width-g.opt.margins[1]:g.opt.margins[3]}}for(d=0;d<e.paths.length;d++){if(e.paths[d].path){if(!f.subType||f.subType==1){e.paths[d].animation.startPath.push(["RECT",c,e.paths[d].path[0][2],c,e.paths[d].path[0][4],e.paths[d].path[0][5]])}else{j=(e.paths[d].path[0][2]+e.paths[d].path[0][4])/2;e.paths[d].animation.startPath.push(["RECT",e.paths[d].path[0][1],j,e.paths[d].path[0][3],j,e.paths[d].path[0][5]])}}}}break}},_animationAvgXYArray:function(c){var e=[],g=0,d;var f=0;for(d=0;d<c.length;d++){if(c[d][1]!=null){g+=c[d][1];f++}}g=g/f;for(d=0;d<c.length;d++){e.push([c[d][0],c[d][1]==null?null:g])}return e},animationAvg:function(g,f,e){this._animationPiece(e,f,e.subSection);var h=0,d,c;switch(g.opt.type){case"line":switch(e.subSection){case"Plot":if(!e.paths){e.animation.startPath.push(["LINE",this._animationAvgXYArray(e.path[0][1]),e.path[0][2]])}else{c=0;for(d=0;d<e.paths.length;d++){if(e.paths[d].path){c++;h+=e.paths[d].path[0][2]}}h=h/c;for(d=0;d<e.paths.length;d++){if(e.paths[d].path){e.paths[d].animation.startPath.push(["RECT",e.paths[d].path[0][1],h,e.paths[d].path[0][3],e.paths[d].path[0][4]])}}}break;case"Fill":e.animation.startPath.push(["LINEAREA",this._animationAvgXYArray(e.path[0][1]),this._animationAvgXYArray(e.path[0][2]),e.path[0][3]]);break;case"Dot":c=0;for(d=0;d<e.paths.length;d++){if(e.paths[d].path){c++;h+=e.paths[d].path[0][2]}}h=h/c;for(d=0;d<e.paths.length;d++){if(e.paths[d].path){e.paths[d].animation.startPath.push(["CIRCLE",e.paths[d].path[0][1],h,e.paths[d].path[0][3]])}}break}break;case"pie":var j=360/e.paths.length;if(e.subSection=="Plot"){for(d=0;d<e.paths.length;d++){if(e.paths[d].path&&e.paths[d].path[0][0]=="SLICE"){e.paths[d].animation.startPath.push(["SLICE",e.paths[d].path[0][1],e.paths[d].path[0][2],e.paths[d].path[0][3],e.paths[d].path[0][4],d*j,(d+1)*j])}}}break;case"funnel":alert("Unsupported animation AVG for funnel");break;case"barline":alert("Unsupported animation AVG for barline");break}},_animationRegXYArray:function(d){var h=[];var m=d.length;var l=0;var e=m-1;while(d[l][1]==null){l++}while(d[e][1]==null){e--}var j=d[0][1];var g=d[m-1][1];for(var f=0;f<d.length;f++){if(d[f][1]==null){h.push([d[f][0],null])}else{h.push([d[f][0],d[l][1]+(d[e][1]-d[l][1])/(e-l)*(f-l)])}}return h},animationReg:function(j,h,g){this._animationPiece(g,h,g.subSection);var e,l,f,d;switch(j.opt.type){case"line":switch(g.subSection){case"Plot":if(!g.paths){g.animation.startPath.push(["LINE",this._animationRegXYArray(g.path[0][1]),g.path[0][2]])}else{l=g.paths.length;if(l>1){for(e=0;!g.paths[e].path&&e<g.paths.length;e++){}f=g.paths[e].path?a.getY(g.paths[e].path[0]):0;for(e=g.paths.length-1;!g.paths[e].path&&e>=0;e--){}d=g.paths[e].path?a.getY(g.paths[e].path[0]):0;for(e=0;e<g.paths.length;e++){if(g.paths[e].path){g.paths[e].animation.startPath.push(["RECT",g.paths[e].path[0][1],f+(d-f)/(l-1)*e,g.paths[e].path[0][3],g.paths[e].path[0][4]])}}}}break;case"Fill":g.animation.startPath.push(["LINEAREA",this._animationRegXYArray(g.path[0][1]),this._animationRegXYArray(g.path[0][2]),g.path[0][3]]);break;case"Dot":l=g.paths.length;if(l>1){for(e=0;!g.paths[e].path&&e<g.paths.length;e++){}f=g.paths[e].path?a.getY(g.paths[e].path[0]):0;for(e=g.paths.length-1;!g.paths[e].path&&e>=0;e--){}d=g.paths[e].path?a.getY(g.paths[e].path[0]):0;for(e=0;e<g.paths.length;e++){if(g.paths[e].path){g.paths[e].animation.startPath.push(["CIRCLE",g.paths[e].path[0][1],f+(d-f)/(l-1)*e,g.paths[e].path[0][3]])}}}break}break;case"pie":alert("Unsupported animation REG for pie");break;case"funnel":alert("Unsupported animation REG for funnel");break;case"barline":alert("Unsupported animation REG for barline");break}}};b.elycharts.featuresmanager.register(b.elycharts.animationmanager,10);b.elycharts.frameanimationmanager={beforeShow:function(c,d){if(c.opt.features.frameAnimation.active){b(c.container.get(0)).css(c.opt.features.frameAnimation.cssFrom)}},afterShow:function(c,d){if(c.opt.features.frameAnimation.active){c.container.animate(c.opt.features.frameAnimation.cssTo,c.opt.features.frameAnimation.speed,c.opt.features.frameAnimation.easing)}}};b.elycharts.featuresmanager.register(b.elycharts.frameanimationmanager,90)})(jQuery);(function(b){var a=b.elycharts.common;b.elycharts.highlightmanager={removeHighlighted:function(d,c){if(d.highlighted){while(d.highlighted.length>0){var e=d.highlighted.pop();if(e.piece){if(c){a.animationStackPush(d,e.piece,e.piece.element,a.getPieceFullAttr(d,e.piece),e.cfg.restoreSpeed,e.cfg.restoreEasing,0,true)}}else{e.element.remove()}}}},afterShow:function(c,d){if(c.highlighted&&c.highlighted.length>0){this.removeHighlighted(c,false)}c.highlighted=[]},onMouseOver:function(D,u,j,H){var s,c;for(var B=0;B<H.pieces.length;B++){if(H.pieces[B].section=="Series"&&H.pieces[B].paths&&(!u||H.pieces[B].serie==u)&&H.pieces[B].paths[j]&&H.pieces[B].paths[j].element){var e=H.pieces[B].paths[j];c=e.element;s=e.path;var v=a.getElementOriginalAttrs(c);var F=false;var f=u?H.props:a.areaProps(D,H.pieces[B].section,H.pieces[B].serie);var r,G,y;if(s&&f.highlight){if(f.highlight.scale){var J=f.highlight.scale;if(typeof J=="number"){J=[J,J]}if(s[0][0]=="RECT"){var o=s[0][3]-s[0][1];var C=s[0][4]-s[0][2];s=[["RECT",s[0][1],s[0][2]-C*(J[1]-1),s[0][3]+o*(J[0]-1),s[0][4]]];a.animationStackPush(D,e,c,a.getSVGProps(D,s),f.highlight.scaleSpeed,f.highlight.scaleEasing)}else{if(s[0][0]=="CIRCLE"){F={r:s[0][3]*J[0]};a.animationStackPush(D,e,c,F,f.highlight.scaleSpeed,f.highlight.scaleEasing)}else{if(s[0][0]=="SLICE"){var E=(s[0][6]-s[0][5])*(J[1]-1)/2;if(E>90){E=90}s=[["SLICE",s[0][1],s[0][2],s[0][3]*J[0],s[0][4],s[0][5]-E,s[0][6]+E]];a.animationStackPush(D,e,c,a.getSVGProps(D,s),f.highlight.scaleSpeed,f.highlight.scaleEasing)}else{if(D.opt.type=="funnel"){var p=(e.rect[2]-e.rect[0])*(J[0]-1)/2;var n=(e.rect[3]-e.rect[1])*(J[1]-1)/2;s=[a.movePath(D,[s[0]],[-p,-n])[0],a.movePath(D,[s[1]],[+p,-n])[0],a.movePath(D,[s[2]],[+p,+n])[0],a.movePath(D,[s[3]],[-p,+n])[0],s[4]];a.animationStackPush(D,e,c,a.getSVGProps(D,s),f.highlight.scaleSpeed,f.highlight.scaleEasing,0,true);r=false;if(j>0){G=H.pieces[B].paths[j-1];r=G.element;y=G.path}else{G=a.findInPieces(H.pieces,"Sector","top");if(G){r=G.element;y=G.path}}if(r){y=[y[0],y[1],a.movePath(D,[y[2]],[+p,-n])[0],a.movePath(D,[y[3]],[-p,-n])[0],y[4]];a.animationStackPush(D,G,r,a.getSVGProps(D,y),f.highlight.scaleSpeed,f.highlight.scaleEasing,0,true);D.highlighted.push({piece:G,cfg:f.highlight})}r=false;if(j<H.pieces[B].paths.length-1){G=H.pieces[B].paths[j+1];r=G.element;y=G.path}else{G=a.findInPieces(H.pieces,"Sector","bottom");if(G){r=G.element;y=G.path}}if(r){y=[a.movePath(D,[y[0]],[-p,+n])[0],a.movePath(D,[y[1]],[+p,+n])[0],y[2],y[3],y[4]];a.animationStackPush(D,G,r,a.getSVGProps(D,y),f.highlight.scaleSpeed,f.highlight.scaleEasing,0,true);D.highlighted.push({piece:G,cfg:f.highlight})}}}}}}if(f.highlight.newProps){for(var I in f.highlight.newProps){if(typeof v[I]=="undefined"){v[I]=false}}a.animationStackPush(D,e,c,f.highlight.newProps)}if(f.highlight.move){var g=b.isArray(f.highlight.move)?f.highlight.move:[f.highlight.move,0];s=a.movePath(D,s,g);a.animationStackPush(D,e,c,a.getSVGProps(D,s),f.highlight.moveSpeed,f.highlight.moveEasing)}D.highlighted.push({piece:e,cfg:f.highlight});if(f.highlight.overlayProps){c=a.showPath(D,s);if(F){c.attr(F)}c.attr(f.highlight.overlayProps);v=false;D.highlighted.push({element:c,attr:v,cfg:f.highlight})}}}}if(D.opt.features.highlight.indexHighlight&&D.opt.type=="line"){var q=D.opt.features.highlight.indexHighlight;if(q=="auto"){q=(D.indexCenter=="bar"?"bar":"line")}var A=(D.width-D.opt.margins[3]-D.opt.margins[1])/(D.opt.labels.length>0?D.opt.labels.length:1);var z=(D.width-D.opt.margins[3]-D.opt.margins[1])/(D.opt.labels.length>1?D.opt.labels.length-1:1);var m=true;switch(q){case"bar":s=[["RECT",D.opt.margins[3]+j*A,D.opt.margins[0],D.opt.margins[3]+(j+1)*A,D.height-D.opt.margins[2]]];break;case"line":m=false;case"barline":var l=Math.round((m?A/2:0)+D.opt.margins[3]+j*(m?A:z));s=[["M",l,D.opt.margins[0]],["L",l,D.height-D.opt.margins[2]]]}if(s){c=a.showPath(D,s).attr(D.opt.features.highlight.indexHighlightProps);D.highlighted.push({element:c,attr:false,cfg:D.opt.features.highlight})}}},onMouseOut:function(e,f,d,c){this.removeHighlighted(e,true)}};b.elycharts.featuresmanager.register(b.elycharts.highlightmanager,21)})(jQuery);(function(b){var a=b.elycharts.common;b.elycharts.labelmanager={beforeShow:function(f,g){if(!a.executeIfChanged(f,["labels","values","series"])){return}if(f.opt.labels&&(f.opt.type=="pie"||f.opt.type=="funnel")){var j=false;var h;for(var d=0;d<g.length;d++){if(g[d].section=="Series"&&g[d].subSection=="Plot"){var e=a.areaProps(f,"Series",g[d].serie);if(f.emptySeries&&f.opt.series.empty){e.label=b.extend(true,e.label,f.opt.series.empty.label)}if(e&&e.label&&e.label.active){h=[];for(var c=0;c<g[d].paths.length;c++){if(g[d].paths[c].path){j=c;h.push(this.showLabel(f,g[d],g[d].paths[c],g[d].serie,c,g))}else{h.push({path:false,attr:false})}}g.push({section:g[d].section,serie:g[d].serie,subSection:"Label",paths:h})}}else{if(g[d].section=="Sector"&&g[d].serie=="bottom"&&!g[d].subSection&&j<f.opt.labels.length-1){h=[];h.push(this.showLabel(f,g[d],g[d],"Series",f.opt.labels.length-1,g));g.push({section:g[d].section,serie:g[d].serie,subSection:"Label",paths:h})}}}}},showLabel:function(o,u,t,m,q,l){var j=a.areaProps(o,"Series",m,q);if(o.opt.labels[q]||j.label.label){var h=t;var s=j.label.label?j.label.label:o.opt.labels[q];var d=a.getCenter(h,j.label.offset);if(!j.label.html){var r=j.label.props;if(j.label.frameAnchor){r=a._clone(j.label.props);r["text-anchor"]=j.label.frameAnchor[0];r["alignment-baseline"]=j.label.frameAnchor[1]}return{path:[["TEXT",s,d[0],d[1]]],attr:r}}else{var n=1;var g=a._clone(j.label.style);var f=(typeof g.opacity!="undefined");if(f){n=g.opacity;g.opacity=0}g.position="absolute";g["z-index"]=25;var i;if(typeof s=="string"){i=b("<div>"+s+"</div>").css(g).prependTo(o.container)}else{i=b(s).css(g).prependTo(o.container)}if(o.opt.features.debug.active&&i.height()==0){alert("DEBUG: Al gestore label e' stata passata una label ancora senza dimensioni, quindi ancora non disegnata. Per questo motivo il posizionamento potrebbe non essere correto.")}var e=d[0];var c=d[1];if(!j.label.frameAnchor||j.label.frameAnchor[0]=="middle"){e-=i.width()/2}else{if(j.label.frameAnchor&&j.label.frameAnchor[0]=="end"){e-=i.width()}}if(!j.label.frameAnchor||j.label.frameAnchor[1]=="middle"){c-=i.height()/2}else{if(j.label.frameAnchor&&j.label.frameAnchor[1]=="top"){c-=i.height()}}if(f){i.css({margin:c+"px 0 0 "+e+"px",opacity:n})}else{i.css({margin:c+"px 0 0 "+e+"px"})}return{path:[["DOMELEMENT",i]],attr:false}}}return false}};b.elycharts.featuresmanager.register(b.elycharts.labelmanager,5)})(jQuery);(function(b){var a=b.elycharts.common;b.elycharts.legendmanager={afterShow:function(L,l){if(L.legenditems){for(item in L.legenditems){L.legenditems[item].remove()}L.legenditems=false}if(!L.opt.legend||L.opt.legend.length==0){return}var d=L.opt.features.legend;if(d===false){return}var e=d.x;if(e=="auto"){var D=1;e=0}var c=d.width;if(c=="auto"){var o=1;c=L.width}var H=0;var A=[];var f=0;var B,M,K,r,q,p,G;for(B in L.opt.legend){if(L.opt.type!="pie"){f++}else{f+=L.opt.legend[B].length}}var J=0;for(B in L.opt.legend){if(L.opt.type!="pie"){M=[L.opt.legend[B]]}else{M=L.opt.legend[B]}for(var I=0;I<M.length;I++){var m=a.areaProps(L,"Series",B,L.opt.type=="pie"?I:false);var C=b.extend(true,{},d);if(m.legend){C=b.extend(true,C,m.legend)}var F=a.getItemColor(L,B,L.opt.type=="pie"?I:false);if(F){a.colorize(L,C,[["dotProps","fill"]],F)}if(!C.dotProps.fill&&L.opt.type=="pie"){if(m.plotProps&&m.plotProps.fill){C.dotProps.fill=m.plotProps.fill}}var g=d.margins?d.margins[0]+d.margins[2]:0;var n=d.margins?d.margins[1]+d.margins[3]:0;var N=d.margins?d.margins[0]:0;var z=d.margins?d.margins[3]:0;if(!d.horizontal){K=(d.height-g)/f;r=c-n;q=Math.floor(e+z);p=Math.floor(d.y+N+K*J)}else{K=d.height-g;if(!d.itemWidth||d.itemWidth=="fixed"){r=(c-n)/f;q=Math.floor(e+z+r*J)}else{r=(c-n)-H;q=e+z+H}p=Math.floor(d.y+N)}if(C.dotType=="rect"){A.push(a.showPath(L,[["RECT",d.dotMargins[0]+q,p+Math.floor((K-C.dotHeight)/2),d.dotMargins[0]+q+C.dotWidth,p+Math.floor((K-C.dotHeight)/2)+C.dotHeight,C.dotR]]).attr(C.dotProps));G=d.dotMargins[0]+C.dotWidth+d.dotMargins[1]}else{if(C.dotType=="circle"){A.push(a.showPath(L,[["CIRCLE",d.dotMargins[0]+q+C.dotR,p+(K/2),C.dotR]]).attr(C.dotProps));G=d.dotMargins[0]+C.dotR*2+d.dotMargins[1]}}var v=M[I];var u=a.showPath(L,[["TEXT",v,q+G,p+Math.ceil(K/2)+(Raphael.VML?2:0)]]).attr({"text-anchor":"start"}).attr(C.textProps);A.push(u);while(u.getBBox().width>(r-G)&&u.getBBox().width>10){v=v.substring(0,v.length-1);u.attr({text:v})}u.show();if(d.horizontal&&d.itemWidth=="auto"){H+=G+u.getBBox().width+4}else{if(!d.horizontal&&o){H=u.getBBox().width+G>H?u.getBBox().width+G:H}else{H+=r}}J++}}if(o){c=H+d.margins[3]+d.margins[1]-1}if(D){e=Math.floor((L.width-c)/2);for(J in A){if(A[J].attrs.x){A[J].attr("x",A[J].attrs.x+e)}else{A[J].attr("path",a.movePath(L,A[J].attrs.path,[e,0]))}}}var s=[["RECT",e,d.y,e+c,d.y+d.height,d.r]];var E=a.showPath(L,s).attr(d.borderProps);for(J in A){A[J].toFront()}A.unshift(E);L.legenditems=A}};b.elycharts.featuresmanager.register(b.elycharts.legendmanager,90)})(jQuery);(function(c){var a=c.elycharts.featuresmanager;var b=c.elycharts.common;c.elycharts.mousemanager={clear:function(d){if(d.mouseLayer){d.mouseLayer.remove();d.mouseLayer=null;d.mousePaper.clear();d.mousePaper.remove();d.mousePaper=null;d.mouseTimer=null;d.mouseAreas=null}},afterShow:function(n,g){if(!n.opt.interactive){return}this.clear(n);n.mouseLayer=c("<div></div>").css({position:"absolute","z-index":20,opacity:1}).prependTo(n.container);n.mousePaper=b._RaphaelInstance(n.mouseLayer.get(0),n.width,n.height);var f=n.mousePaper;if(n.opt.features.debug.active&&typeof DP_Debug!="undefined"){n.paper.text(n.width,n.height-5,"DEBUG").attr({"text-anchor":"end",stroke:"red",opacity:0.1});f.text(n.width,n.height-5,"DEBUG").attr({"text-anchor":"end",stroke:"red",opacity:0.1}).click(function(){DP_Debug.dump(n.opt,"",false,4)})}var l,h;n.mouseAreas=[];if(n.opt.features.mousearea.type=="single"){for(l=0;l<g.length;l++){if(g[l].mousearea){if(!g[l].paths){if(g[l].path.length>=1&&(g[l].path[0][0]=="LINE"||g[l].path[0][0]=="LINEAREA")){for(h=0;h<g[l].path[0][1].length;h++){var o=b.areaProps(n,g[l].section,g[l].serie);if(o.mouseareaShowOnNull||g[l].section!="Series"||n.opt.values[g[l].serie][h]!=null){n.mouseAreas.push({path:[["CIRCLE",g[l].path[0][1][h][0],g[l].path[0][1][h][1],10]],piece:g[l],pieces:g,index:h,props:o})}}}else{for(h=0;h<g[l].path.length;h++){n.mouseAreas.push({path:[["CIRCLE",b.getX(g[l].path[h]),b.getY(g[l].path[h]),10]],piece:g[l],pieces:g,index:h,props:b.areaProps(n,g[l].section,g[l].serie)})}}}else{if(g[l].paths){for(h=0;h<g[l].paths.length;h++){if(g[l].paths[h].path){n.mouseAreas.push({path:g[l].paths[h].path,piece:g[l],pieces:g,index:h,props:b.areaProps(n,g[l].section,g[l].serie)})}}}}}}}else{var d=n.opt.features.mousearea.indexCenter;if(d=="auto"){d=n.indexCenter}var e,r;if(d=="bar"){r=(n.width-n.opt.margins[3]-n.opt.margins[1])/(n.opt.labels.length>0?n.opt.labels.length:1);e=n.opt.margins[3]}else{r=(n.width-n.opt.margins[3]-n.opt.margins[1])/(n.opt.labels.length>1?n.opt.labels.length-1:1);e=n.opt.margins[3]-r/2}for(var q in n.opt.labels){var m=parseInt(q);n.mouseAreas.push({path:[["RECT",e+m*r,n.height-n.opt.margins[2],e+(m+1)*r,n.opt.margins[0]]],piece:false,pieces:g,index:parseInt(m),props:n.opt.defaultSeries})}}var p=false;if(!n.opt.features.mousearea.syncTag){n.mouseareaenv={chartEnv:false,mouseObj:false,caller:false,inArea:-1,timer:false};p=n.mouseareaenv}else{if(!c.elycharts.mouseareaenv){c.elycharts.mouseareaenv={}}if(!c.elycharts.mouseareaenv[n.opt.features.mousearea.syncTag]){c.elycharts.mouseareaenv[n.opt.features.mousearea.syncTag]={chartEnv:false,mouseObj:false,caller:false,inArea:-1,timer:false}}p=c.elycharts.mouseareaenv[n.opt.features.mousearea.syncTag]}for(l=0;l<n.mouseAreas.length;l++){n.mouseAreas[l].area=b.showPath(n,n.mouseAreas[l].path,f).attr({stroke:"#000",fill:"#fff",opacity:0});(function(u,w,v,s,j){var t=w.piece;var i=w.index;w.mouseover=function(x){w.event=x;clearTimeout(j.timer);s.onMouseOverArea(u,t,i,w);if(j.chartEnv&&j.chartEnv.id!=u.id){j.caller.onMouseExitArea(j.chartEnv,j.mouseObj.piece,j.mouseObj.index,j.mouseObj);s.onMouseEnterArea(u,t,i,w)}else{if(j.inArea!=v){if(j.inArea<0){s.onMouseEnterArea(u,t,i,w)}else{s.onMouseChangedArea(u,t,i,w)}}}j.chartEnv=u;j.mouseObj=w;j.caller=s;j.inArea=v};w.mouseout=function(x){w.event=x;clearTimeout(j.timer);s.onMouseOutArea(u,t,i,w);j.timer=setTimeout(function(){j.timer=false;s.onMouseExitArea(u,t,i,w);j.chartEnv=false;j.inArea=-1},u.opt.features.mousearea.areaMoveDelay)};c(w.area.node).mouseover(w.mouseover);c(w.area.node).mouseout(w.mouseout)})(n,n.mouseAreas[l],l,this,p)}},onMouseOverArea:function(g,f,e,d){if(g.opt.features.mousearea.onMouseOver){g.opt.features.mousearea.onMouseOver(g,d.piece?d.piece.serie:false,d.index,d)}a.onMouseOver(g,d.piece?d.piece.serie:false,d.index,d)},onMouseOutArea:function(g,f,e,d){if(g.opt.features.mousearea.onMouseOut){g.opt.features.mousearea.onMouseOut(g,d.piece?d.piece.serie:false,d.index,d)}a.onMouseOut(g,d.piece?d.piece.serie:false,d.index,d)},onMouseEnterArea:function(g,f,e,d){if(g.opt.features.mousearea.onMouseEnter){g.opt.features.mousearea.onMouseEnter(g,d.piece?d.piece.serie:false,d.index,d)}a.onMouseEnter(g,d.piece?d.piece.serie:false,d.index,d)},onMouseChangedArea:function(g,f,e,d){if(g.opt.features.mousearea.onMouseChanged){g.opt.features.mousearea.onMouseChanged(g,d.piece?d.piece.serie:false,d.index,d)}a.onMouseChanged(g,d.piece?d.piece.serie:false,d.index,d)},onMouseExitArea:function(g,f,e,d){if(g.opt.features.mousearea.onMouseExit){g.opt.features.mousearea.onMouseExit(g,d.piece?d.piece.serie:false,d.index,d)}a.onMouseExit(g,d.piece?d.piece.serie:false,d.index,d)}};c.elycharts.featuresmanager.register(c.elycharts.mousemanager,0)})(jQuery);(function(b){var a=b.elycharts.common;b.elycharts.tooltipmanager={clear:function(c){if(c.tooltipContainer){c.tooltipFrame.clear();c.tooltipFrame.remove();c.tooltipFrame=null;c.tooltipFrameElement=null;c.tooltipContent.remove();c.tooltipContent=null;c.tooltipContainer.remove();c.tooltipContainer=null}},afterShow:function(c,d){this.clear(c);if(!b.elycharts.tooltipid){b.elycharts.tooltipid=0}b.elycharts.tooltipid++;c.tooltipContainer=b('<div id="elycharts_tooltip_'+b.elycharts.tooltipid+'" style="position: absolute; top: 100; left: 100; z-index: 10; overflow: hidden; white-space: nowrap; display: none"><div id="elycharts_tooltip_'+b.elycharts.tooltipid+'_frame" style="position: absolute; top: 0; left: 0; z-index: -1"></div><div id="elycharts_tooltip_'+b.elycharts.tooltipid+'_content" style="cursor: default"></div></div>').appendTo(document.body);c.tooltipFrame=a._RaphaelInstance("elycharts_tooltip_"+b.elycharts.tooltipid+"_frame",500,500);c.tooltipContent=b("#elycharts_tooltip_"+b.elycharts.tooltipid+"_content")},_prepareShow:function(e,d,c,g){if(d.width&&d.width!="auto"&&d.height&&d.height!="auto"){var j=d.frameProps&&d.frameProps["stroke-width"]?d.frameProps["stroke-width"]:0;e.tooltipContainer.width(d.width+j+1).height(d.height+j+1);if(!e.tooltipFrameElement&&d.frameProps){var f=[["RECT",j/2,j/2,d.width,d.height,d.roundedCorners]];e.tooltipFrameElement=a.showPath(e,f,e.tooltipFrame).attr(d.frameProps)}}if(e.tooltipFrameElement){e.tooltipFrameElement.attr(d.frameProps)}if(d.padding){e.tooltipContent.css({padding:d.padding[0]+"px "+d.padding[1]+"px"})}e.tooltipContent.css(d.contentStyle);e.tooltipContent.html(g);var h=b(e.container).offset();if(e.opt.features.tooltip.fixedPos){h.top+=e.opt.features.tooltip.fixedPos[1];h.left+=e.opt.features.tooltip.fixedPos[0]}else{var i=this.getXY(e,d,c);if(!i[2]){h.left+=i[0];while(h.top+i[1]<0){i[1]+=20}h.top+=i[1]}else{h.left=i[0];h.top=i[1]}}return{top:h.top,left:h.left}},getXY:function(e,i,c){var m=0,l=0;if(c.path[0][0]=="RECT"){m=a.getX(c.path[0])-i.offset[1];l=a.getY(c.path[0])-i.height-i.offset[0]}else{if(c.path[0][0]=="CIRCLE"){m=a.getX(c.path[0])-i.offset[1];l=a.getY(c.path[0])-i.height-i.offset[0]}else{if(c.path[0][0]=="SLICE"){var p=c.path[0];var n=i.width&&i.width!="auto"?i.width:100;var d=i.height&&i.height!="auto"?i.height:100;var f=Math.sqrt(Math.pow(n,2)+Math.pow(d,2))/2;if(f>e.opt.r){f=e.opt.r}var o=p[5]+(p[6]-p[5])/2+180;var g=Math.PI/180;m=p[1]+f*Math.cos(-o*g)-n/2;l=p[2]+f*Math.sin(-o*g)-d/2}else{if(c.piece&&c.piece.paths&&c.index>=0&&c.piece.paths[c.index]&&c.piece.paths[c.index].rect){var j=c.piece.paths[c.index].rect;m=j[0]-i.offset[1];l=j[1]-i.height-i.offset[0]}}}}if(e.opt.features.tooltip.positionHandler){return e.opt.features.tooltip.positionHandler(e,i,c,m,l)}else{return[m,l]}},getTip:function(d,e,c){var f=false;if(d.opt.tooltips){if(typeof d.opt.tooltips=="function"){f=d.opt.tooltips(d,e,c,e&&d.opt.values[e]&&d.opt.values[e][c]?d.opt.values[e][c]:false,d.opt.labels&&d.opt.labels[c]?d.opt.labels[c]:false)}else{if(e&&d.opt.tooltips[e]&&d.opt.tooltips[e][c]){f=d.opt.tooltips[e][c]}else{if(!e&&d.opt.tooltips[c]){f=d.opt.tooltips[c]}}}}return f},_getProps:function(g,h,e,d){var f=d.props.tooltip;if(g.emptySeries&&g.opt.series.empty){f=b.extend(true,f,g.opt.series.empty.tooltip)}if(!f||!f.active){return false}if(f.frameProps){var c=a.getItemColor(g,h,e);if(c){f=a._clone(f);a.colorize(g,f,[["frameProps","stroke"]],c)}}return f},_fadeOut:function(c){c.tooltipContainer.fadeOut(c.opt.features.tooltip.fadeDelay)},onMouseEnter:function(f,g,d,c){var e=this._getProps(f,g,d,c);if(!e){return false}var h=this.getTip(f,g,d);if(!h){this._fadeOut(f);return true}f.tooltipContainer.css(this._prepareShow(f,e,c,h)).fadeIn(f.opt.features.tooltip.fadeDelay);return true},onMouseChanged:function(f,g,d,c){var e=this._getProps(f,g,d,c);if(!e){return false}var h=this.getTip(f,g,d);if(!h){this._fadeOut(f);return true}f.tooltipContainer.clearQueue();f.tooltipContainer.fadeIn(f.opt.features.tooltip.fadeDelay);f.tooltipContainer.animate(this._prepareShow(f,e,c,h),f.opt.features.tooltip.moveDelay,"linear");return true},onMouseExit:function(f,g,d,c){var e=this._getProps(f,g,d,c);if(!e){return false}this._fadeOut(f);return true}};b.elycharts.featuresmanager.register(b.elycharts.tooltipmanager,20)})(jQuery);(function(b){var a=b.elycharts.common;b.elycharts.line={init:function(c){},_getColorizationKey:function(c){if(c=="line"){return[["plotProps","stroke"],["dotProps","fill"],["fillProps","fill"]]}else{return[["plotProps","stroke"],["plotProps","fill"]]}},draw:function(n){if(a.executeIfChanged(n,["values","series"])){n.plots={};n.axis={x:{}};n.barno=0;n.indexCenter="line"}var z=n.opt;var N=n.plots;var A=n.axis;var f=n.paper;var X=n.opt.values;var q=n.opt.labels;var S,o,E,B,e,m;if(a.executeIfChanged(n,["values","series"])){var V=0;var O=false;for(B in X){e={index:V,type:false,visible:false};N[B]=e;if(X[B]){E=a.areaProps(n,"Series",B);e.type=E.type;if(E.type=="bar"){n.indexCenter="bar"}if(E.visible){e.visible=true;if(!m||m<X[B].length){m=X[B].length}var I=[];for(S=0;S<X[B].length;S++){var F=X[B][S];if(E.avgOverNulls&&F==null){if(E.type=="bar"){F=0}else{for(var R=S+1;R<X[B].length&&X[B][R]==null;R++){}var h=R<X[B].length?X[B][R]:null;for(var Q=S-1;Q>=0&&X[B][Q]==null;Q--){}var H=Q>=0?X[B][Q]:null;F=h!=null?(H!=null?(h*(S-Q)+H*(R-S))/(R-Q):h):H}}I.push(F)}if(E.stacked&&!(typeof E.stacked=="string")){E.stacked=O}if(typeof E.stacked=="undefined"||E.stacked==B||E.stacked<0||!N[E.stacked]||!N[E.stacked].visible||N[E.stacked].type!=e.type){e.ref=B;if(E.type=="bar"){e.barno=n.barno++}e.from=[];if(!E.cumulative){e.to=I}else{e.to=[];o=0;for(S=0;S<I.length;S++){e.to.push(o+=I[S]!=null?I[S]:0)}}for(S=0;S<I.length;S++){e.from.push(e.to[S]!=null?0:null)}}else{e.ref=E.stacked;if(E.type=="bar"){e.barno=N[E.stacked].barno}e.from=N[E.stacked].stack;e.to=[];o=0;if(!E.cumulative){for(S=0;S<I.length;S++){e.to.push(e.from[S]+(I[S]!=null?I[S]:0))}}else{for(S=0;S<I.length;S++){e.to.push(e.from[S]+(o+=(I[S]!=null?I[S]:0)))}}N[E.stacked].stack=e.to}e.stack=e.to;e.max=Math.max.apply(Math,e.from.concat(e.to));e.min=Math.min.apply(Math,e.from.concat(e.to));if(E.axis){if(!A[E.axis]){A[E.axis]={plots:[]}}A[E.axis].plots.push(B);if(typeof A[E.axis].max=="undefined"){A[E.axis].max=e.max}else{A[E.axis].max=Math.max(A[E.axis].max,e.max)}if(typeof A[E.axis].min=="undefined"){A[E.axis].min=e.min}else{A[E.axis].min=Math.min(A[E.axis].min,e.min)}}O=B}}}}if(!q){q=[]}while(m>q.length){q.push(null)}m=q.length;n.opt.labels=q;if(a.executeIfChanged(n,["values","series","axis"])){for(var s in A){E=a.areaProps(n,"Axis",s);A[s].props=E;if(typeof E.max!="undefined"){A[s].max=E.max}if(typeof E.min!="undefined"){A[s].min=E.min}if(A[s].min==A[s].max){A[s].max=A[s].min+1}if(E.normalize&&E.normalize>0){var M=Math.abs(A[s].max);if(A[s].min&&Math.abs(A[s].min)>M){M=Math.abs(A[s].min)}if(M){var C=Math.floor(Math.log(M)/Math.LN10)-(E.normalize-1);C=C>=0?Math.pow(10,C):1/Math.pow(10,-C);M=Math.ceil(M/C/(z.features.grid.ny?z.features.grid.ny:1))*C*(z.features.grid.ny?z.features.grid.ny:1);M=Math.round(M/C)*C;A[s].normalizationBase=C;if(A[s].max){A[s].max=Math.ceil(A[s].max/M)*M}if(A[s].min){A[s].min=Math.floor(A[s].min/M)*M}}}if(A[s].plots){for(var J=0;J<A[s].plots.length;J++){N[A[s].plots[J]].max=A[s].max;N[A[s].plots[J]].min=A[s].min}}}}var T=[];this.grid(n,T);var t=(n.width-z.margins[3]-z.margins[1])/(q.length>1?q.length-1:1);var P=(n.width-z.margins[3]-z.margins[1])/(q.length>0?q.length:1);for(B in X){E=a.areaProps(n,"Series",B);e=N[B];a.colorize(n,E,this._getColorizationKey(E.type),a.getItemColor(n,B));if(E.lineCenter&&E.lineCenter=="auto"){E.lineCenter=(n.indexCenter=="bar")}else{if(E.lineCenter&&n.indexCenter=="line"){n.indexCenter="bar"}}if(X[B]&&E.visible){var r=(n.height-z.margins[2]-z.margins[0])/(e.max-e.min);if(E.type=="line"){var D=["LINE",[],E.rounded];var g=["LINEAREA",[],[],E.rounded];var W=[];for(S=0,J=q.length;S<J;S++){if(e.to.length>S){var Y=a.areaProps(n,"Series",B,S);a.colorize(n,Y,this._getColorizationKey(E.type),a.getItemColor(n,B,S));var L=Math.round((E.lineCenter?P/2:0)+z.margins[3]+S*(E.lineCenter?P:t));var K=null;if(e.to[S]!=null){var U=e.to[S]>e.max?e.max:(e.to[S]<e.min?e.min:e.to[S]);K=Math.round(n.height-z.margins[2]-r*(U-e.min))}var p=null;if(e.from[S]!=null){var u=e.from[S]>e.max?e.max:(e.from[S]<e.min?e.min:e.from[S]);p=Math.round(n.height-z.margins[2]-r*(u-e.min))+(Raphael.VML?1:0)}D[1].push([L,K]);if(E.fill){g[1].push([L,K]);g[2].push([L,p])}if(Y.dot){if(X[B][S]==null&&!Y.dotShowOnNull){W.push({path:false,attr:false})}else{W.push({path:[["CIRCLE",L,K,Y.dotProps.size]],attr:Y.dotProps})}}}}if(E.fill){T.push({section:"Series",serie:B,subSection:"Fill",path:[g],attr:E.fillProps})}else{T.push({section:"Series",serie:B,subSection:"Fill",path:false,attr:false})}T.push({section:"Series",serie:B,subSection:"Plot",path:[D],attr:E.plotProps,mousearea:"pathsteps"});if(W.length){T.push({section:"Series",serie:B,subSection:"Dot",paths:W})}else{T.push({section:"Series",serie:B,subSection:"Dot",path:false,attr:false})}}else{pieceBar=[];for(S=0,J=q.length;S<J;S++){if(e.to.length>S){if(e.from[S]!=e.to[S]){var Y=a.areaProps(n,"Series",B,S);a.colorize(n,Y,this._getColorizationKey(E.type),a.getItemColor(n,B,S));var l=Math.floor((P-z.barMargins)/(1+(n.barno-1)*(100-z.barOverlapPerc)/100));var G=l*(100-E.barWidthPerc)/200;var c=z.barMargins/2+e.barno*(l*(100-z.barOverlapPerc)/100);var w=Math.floor(z.margins[3]+S*P+c+G);var aa=Math.round(n.height-z.margins[2]-r*(e.to[S]-e.min));var Z=Math.round(n.height-z.margins[2]-r*(e.from[S]-e.min));pieceBar.push({path:[["RECT",w,aa,w+l-G*2,Z]],attr:Y.plotProps})}else{pieceBar.push({path:false,attr:false})}}}if(pieceBar.length){T.push({section:"Series",serie:B,subSection:"Plot",paths:pieceBar,mousearea:"paths"})}else{T.push({section:"Series",serie:B,subSection:"Plot",path:false,attr:false,mousearea:"paths"})}}}else{if(E.type=="line"){T.push({section:"Series",serie:B,subSection:"Fill",path:false,attr:false})}T.push({section:"Series",serie:B,subSection:"Plot",path:false,attr:false,mousearea:"paths"});if(E.type=="line"){T.push({section:"Series",serie:B,subSection:"Dot",path:false,attr:false})}}}return T},grid:function(l,ab){if(a.executeIfChanged(l,["values","series","axis","labels","margins","width","height","features.grid"])){var C=l.opt;var I=l.opt.features.grid;var c=l.paper;var E=l.axis;var r=l.opt.labels;var w=(l.width-C.margins[3]-C.margins[1])/(r.length>1?r.length-1:1);var W=(l.width-C.margins[3]-C.margins[1])/(r.length>0?r.length:1);var aa,Z,R,Q,G,X,V,e,J,o;var M=[];var m=I.labelsCenter;if(m=="auto"){m=(l.indexCenter=="bar")}if(E.x&&E.x.props.labels){var H=false;var u=E.x.props.labelsAnchor||"auto";if(u=="auto"){u=E.x.props.labelsRotate>0?"start":(E.x.props.labelsRotate==0?"middle":"end")}var ac=E.x.props.labelsPos||"auto";if(ac=="auto"){ac=m?(E.x.props.labelsRotate==0?u:"middle"):"start"}for(aa=0;aa<r.length;aa++){if((typeof r[aa]!="boolean"&&r[aa]!=null)||r[aa]){if(!E.x.props.labelsSkip||aa>=E.x.props.labelsSkip){J=r[aa];if(E.x.props.labelsFormatHandler){J=E.x.props.labelsFormatHandler(J)}o=(E.x.props.prefix?E.x.props.prefix:"")+J+(E.x.props.suffix?E.x.props.suffix:"");X=C.margins[3]+aa*(m?W:w)+(E.x.props.labelsMargin?E.x.props.labelsMargin:0);if(ac=="middle"){X+=(m?W:w)/2}if(ac=="end"){X+=(m?W:w)}V=l.height-C.margins[2]+E.x.props.labelsDistance;e=c.text(X,V,o).attr(E.x.props.labelsProps).toBack();e.attr({"text-anchor":u});var g=false;var D=e.getBBox();var ae={x:D.x,y:D.y};var ad={x:D.x+D.width,y:D.y+D.height};var q={x:X,y:V};rotate=function(j,i){var y=j.x*Math.cos(i)-j.y*Math.sin(i),x=j.x*Math.sin(i)+j.y*Math.cos(i);return{x:y,y:x}};collide=function(j,i,ah){xor=function(aj,ai){return(aj||ai)&&!(aj&&ai)};if(j.alpha!=i.alpha){throw"collide doens't support rects with different rotations"}var af=rotate({x:j.p1.x-ah,y:j.p1.y-ah},-j.alpha);var ag=rotate({x:j.p2.x+ah,y:j.p2.y+ah},-j.alpha);var x=rotate({x:i.p1.x-ah,y:i.p1.y-ah},-i.alpha);var y=rotate({x:i.p2.x+ah,y:i.p2.y+ah},-i.alpha);return !xor(Math.min(af.x,ag.x)>Math.max(x.x,y.x),Math.max(af.x,ag.x)<Math.min(x.x,y.x))&&!xor(Math.min(af.y,ag.y)>Math.max(x.y,y.y),Math.max(af.y,ag.y)<Math.min(x.y,y.y))};rotated=function(x,i,af){translate=function(ah,ag){return{x:ah.x+ag.x,y:ah.y+ag.y}};negate=function(ag){return{x:-ag.x,y:-ag.y}};var y=translate(rotate(translate(x.p1,negate(i)),af),i);var j=translate(rotate(translate(x.p2,negate(i)),af),i);return{p1:y,p2:j,alpha:x.alpha+af}};D=function(y){if(y.alpha==0){return{x:y.p1.x,y:y.p1.y,width:y.p2.x-y.p1.x,height:y.p2.y-y.p1.y}}else{var j=[];j.push({x:0,y:0});j.push({x:y.p2.x-y.p1.x,y:0});j.push({x:0,y:y.p2.y-y.p1.y});j.push({x:y.p2.x-y.p1.x,y:y.p2.y-y.p1.y});var ai=[];ai.left=0;ai.right=0;ai.top=0;ai.bottom=0;for(_px=0;_px<j.length;_px++){var ag=j[_px];var ah=parseInt((ag.x*Math.cos(y.alpha))+(ag.y*Math.sin(y.alpha)));var af=parseInt((ag.x*Math.sin(y.alpha))+(ag.y*Math.cos(y.alpha)));ai.left=Math.min(ai.left,ah);ai.right=Math.max(ai.right,ah);ai.top=Math.min(ai.top,af);ai.bottom=Math.max(ai.bottom,af)}var x=parseInt(Math.abs(ai.right-ai.left));var i=parseInt(Math.abs(ai.bottom-ai.top));var ah=((y.p1.x+y.p2.x)/2)-x/2;var af=((y.p1.y+y.p2.y)/2)-i/2;return{x:ah,y:af,width:x,height:i}}};var Y=Raphael.rad(E.x.props.labelsRotate);var K=rotated({p1:ae,p2:ad,alpha:0},q,Y);var h=E.x.props.labelsMarginRight?E.x.props.labelsMarginRight/2:0;if(E.x.props.labelsHideCovered&&H&&collide(K,H,h)){e.hide()}else{g=D(K);if(I.nx=="auto"&&(g.x<0||g.x+g.width>l.width)){e.hide()}else{H=K}}if(E.x.props.labelsRotate){if(Raphael.animation){e.transform(Raphael.format("r{0},{1},{2}",E.x.props.labelsRotate,X,V)).toBack()}else{e.rotate(E.x.props.labelsRotate,X,V).toBack()}}M.push({path:[["RELEMENT",e]],attr:false})}}}}ab.push({section:"Axis",serie:"x",subSection:"Label",paths:M});if(E.x&&E.x.props.title){R=C.margins[3]+Math.floor((l.width-C.margins[1]-C.margins[3])/2);Q=l.height-C.margins[2]+E.x.props.titleDistance*(Raphael.VML?E.x.props.titleDistanceIE:1);ab.push({section:"Axis",serie:"x",subSection:"Title",path:[["TEXT",E.x.props.title,R,Q]],attr:E.x.props.titleProps})}else{ab.push({section:"Axis",serie:"x",subSection:"Title",path:false,attr:false})}for(var z in ["l","r"]){Z=["l","r"][z];if(E[Z]&&E[Z].props.labels&&I.ny){M=[];for(aa=E[Z].props.labelsSkip?E[Z].props.labelsSkip:0;aa<=I.ny;aa++){var t=(l.height-C.margins[2]-C.margins[0])/I.ny;if(Z=="r"){X=l.width-C.margins[1]+E[Z].props.labelsDistance;if(!E[Z].props.labelsProps["text-anchor"]){E[Z].props.labelsProps["text-anchor"]="start"}}else{X=C.margins[3]-E[Z].props.labelsDistance;if(!E[Z].props.labelsProps["text-anchor"]){E[Z].props.labelsProps["text-anchor"]="end"}}if(E[Z].props.labelsAnchor&&E[Z].props.labelsAnchor!="auto"){E[Z].props.labelsProps["text-anchor"]=E[Z].props.labelsAnchor}J=(E[Z].min+(aa*((E[Z].max-E[Z].min)/I.ny)));if(E[Z].normalizationBase){J=Math.round(J/E[Z].normalizationBase)/(1/E[Z].normalizationBase)}if(E[Z].props.labelsFormatHandler){J=E[Z].props.labelsFormatHandler(J)}if(E[Z].props.labelsCompactUnits){J=a.compactUnits(J,E[Z].props.labelsCompactUnits)}o=(E[Z].props.prefix?E[Z].props.prefix:"")+J+(E[Z].props.suffix?E[Z].props.suffix:"");V=l.height-C.margins[2]-aa*t;M.push({path:[["TEXT",o,X,V+(E[Z].props.labelsMargin?E[Z].props.labelsMargin:0)]],attr:E[Z].props.labelsProps})}ab.push({section:"Axis",serie:Z,subSection:"Label",paths:M})}else{ab.push({section:"Axis",serie:Z,subSection:"Label",paths:[]})}if(E[Z]&&E[Z].props.title){if(Z=="r"){R=l.width-C.margins[1]+E[Z].props.titleDistance*(Raphael.VML?E[Z].props.titleDistanceIE:1)}else{R=C.margins[3]-E[Z].props.titleDistance*(Raphael.VML?E[Z].props.titleDistanceIE:1)}var B=a._clone(E[Z].props.titleProps);var L=Z=="l"?270:90;var Q=C.margins[0]+Math.floor((l.height-C.margins[0]-C.margins[2])/2);if(Raphael.animation){var e=c.text(R,Q,E[Z].props.title).attr(B).transform(Raphael.format("r{0}",L)).toBack();ab.push({section:"Axis",serie:Z,subSection:"Title",path:[["RELEMENT",e]],attr:false})}else{B.rotation=L;ab.push({section:"Axis",serie:Z,subSection:"Title",path:[["TEXT",E[Z].props.title,R,Q]],attr:B})}}else{ab.push({section:"Axis",serie:Z,subSection:"Title",path:false,attr:false})}}if(I.nx||I.ny){var S=[],A=[],n=[],U=I.nx=="auto"?(m?r.length:r.length-1):I.nx,T=I.ny,f=(l.height-C.margins[2]-C.margins[0])/(T?T:1),p=(l.width-C.margins[1]-C.margins[3])/(U?U:1),P=typeof I.forceBorder=="object"?I.forceBorder[3]:I.forceBorder,O=typeof I.forceBorder=="object"?I.forceBorder[1]:I.forceBorder,v=typeof I.forceBorder=="object"?I.forceBorder[0]:I.forceBorder,s=typeof I.forceBorder=="object"?I.forceBorder[2]:I.forceBorder,N=T>0?(typeof I.draw=="object"?I.draw[0]:I.draw):false,F=U>0?typeof I.draw=="object"?I.draw[1]:I.draw:false;if(T>0){for(aa=0;aa<T+1;aa++){if(v&&aa==0||s&&aa==T||N&&aa>0&&aa<T){S.push(["M",C.margins[3]-I.extra[3],C.margins[0]+Math.round(aa*f)]);S.push(["L",l.width-C.margins[1]+I.extra[1],C.margins[0]+Math.round(aa*f)])}if(aa<T){if(aa%2==0&&I.evenHProps||aa%2==1&&I.oddHProps){A.push({path:[["RECT",C.margins[3]-I.extra[3],C.margins[0]+Math.round(aa*f),l.width-C.margins[1]+I.extra[1],C.margins[0]+Math.round((aa+1)*f)]],attr:aa%2==0?I.evenHProps:I.oddHProps})}else{A.push({path:false,attr:false})}}}}for(aa=0;aa<U+1;aa++){if(P&&aa==0||O&&aa==U||F&&((I.nx!="auto"&&aa>0&&aa<U)||(I.nx=="auto"&&(typeof r[aa]!="boolean"||r[aa])))){S.push(["M",C.margins[3]+Math.round(aa*p),C.margins[0]-I.extra[0]]);S.push(["L",C.margins[3]+Math.round(aa*p),l.height-C.margins[2]+I.extra[2]])}if(aa<U){if(aa%2==0&&I.evenVProps||aa%2==1&&I.oddVProps){n.push({path:[["RECT",C.margins[3]+Math.round(aa*p),C.margins[0]-I.extra[0],C.margins[3]+Math.round((aa+1)*p),l.height-C.margins[2]+I.extra[2],]],attr:aa%2==0?I.evenVProps:I.oddVProps})}else{n.push({path:false,attr:false})}}}ab.push({section:"Grid",path:S.length?S:false,attr:S.length?I.props:false});ab.push({section:"GridBandH",paths:A});ab.push({section:"GridBandV",paths:n});var d=[];if(I.ticks.active&&(typeof I.ticks.active!="object"||I.ticks.active[0])){for(aa=0;aa<U+1;aa++){if(I.nx!="auto"||typeof r[aa]!="boolean"||r[aa]){d.push(["M",C.margins[3]+Math.round(aa*p),l.height-C.margins[2]-I.ticks.size[1]]);d.push(["L",C.margins[3]+Math.round(aa*p),l.height-C.margins[2]+I.ticks.size[0]])}}}if(I.ticks.active&&(typeof I.ticks.active!="object"||I.ticks.active[1])){for(aa=0;aa<T+1;aa++){d.push(["M",C.margins[3]-I.ticks.size[0],C.margins[0]+Math.round(aa*f)]);d.push(["L",C.margins[3]+I.ticks.size[1],C.margins[0]+Math.round(aa*f)])}}if(I.ticks.active&&(typeof I.ticks.active!="object"||I.ticks.active[2])){for(aa=0;aa<T+1;aa++){d.push(["M",l.width-C.margins[1]-I.ticks.size[1],C.margins[0]+Math.round(aa*f)]);d.push(["L",l.width-C.margins[1]+I.ticks.size[0],C.margins[0]+Math.round(aa*f)])}}ab.push({section:"Ticks",path:d.length?d:false,attr:d.length?I.ticks.props:false})}}}}})(jQuery);(function(b){var a=b.elycharts.common;b.elycharts.pie={init:function(c){},draw:function(E){var d=E.opt;var p=E.width-E.opt.margins[1]-E.opt.margins[3];var C=E.height-E.opt.margins[0]-E.opt.margins[2];var t=E.opt.r?E.opt.r:Math.floor((p<C?p:C)/2*(E.opt.rPerc?E.opt.rPerc/100:0.8));var f=(E.opt.cx?E.opt.cx:Math.floor(p/2))+E.opt.margins[3];var e=(E.opt.cy?E.opt.cy:Math.floor(C/2))+E.opt.margins[0];var A=0,B,s,v,z,g;for(v in d.values){z={visible:false,total:0,values:[]};E.plots[v]=z;var c=a.areaProps(E,"Series",v);a.colorize(E,c,[["plotProps","stroke"],["plotProps","fill"]],a.getItemColor(E,v));if(c.visible){z.visible=true;A++;z.values=d.values[v];for(B=0,s=z.values.length;B<s;B++){if(z.values[B]>0){g=a.areaProps(E,"Series",v,B);a.colorize(E,g,[["plotProps","stroke"],["plotProps","fill"]],a.getItemColor(E,v,B));if(typeof g.inside=="undefined"||g.inside<0){z.total+=z.values[B]}}}for(B=0;B<s;B++){if(z.values[B]<z.total*d.valueThresold){z.total=z.total-z.values[B];z.values[B]=0}}}}var u=t/A;var m=-u,j=0;var n=[];for(v in d.values){z=E.plots[v];var y=[];if(z.visible){m+=u;j+=u;var F=E.opt.startAngle,D=0,l=0;if(z.total==0){E.emptySeries=true;g=a.areaProps(E,"Series","empty");a.colorize(E,g,[["plotProps","stroke"],["plotProps","fill"]],a.getItemColor(E,v));y.push({path:[["CIRCLE",f,e,t]],attr:g.plotProps})}else{E.emptySeries=false;for(B=0,s=z.values.length;B<s;B++){var x=z.values[B];if(x>0){g=a.areaProps(E,"Series",v,B);a.colorize(E,g,[["plotProps","stroke"],["plotProps","fill"]],a.getItemColor(E,v,B));if(typeof g.inside=="undefined"||g.inside<0){F+=l;D=360*x/z.total;l=D}else{D=360*values[g.inside]/z.total*x/values[g.inside]}var o=m,q=j;if(g.r){if(g.r>0){if(g.r<=1){q=m+u*g.r}else{q=m+g.r}}else{if(g.r>=-1){o=m+u*(-g.r)}else{o=m-g.r}}}if(!E.opt.clockwise){y.push({path:[["SLICE",f,e,q,o,F,F+D]],attr:g.plotProps})}else{y.push({path:[["SLICE",f,e,q,o,-F-D,-F]],attr:g.plotProps})}}else{y.push({path:false,attr:false})}}}}else{if(d.values[v]&&d.values[v].length){for(B=0,s=d.values[v].length;B<s;B++){y.push({path:false,attr:false})}}}n.push({section:"Series",serie:v,subSection:"Plot",paths:y,mousearea:"paths"})}return n}}})(jQuery);