You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
14 KiB
1 line
14 KiB
2 years ago
|
(function(){var a=window.AmCharts;a.AmSlicedChart=a.Class({inherits:a.AmChart,construct:function(b){this.createEvents("rollOverSlice","rollOutSlice","clickSlice","pullOutSlice","pullInSlice","rightClickSlice");a.AmSlicedChart.base.construct.call(this,b);this.colors="#FF0F00 #FF6600 #FF9E01 #FCD202 #F8FF01 #B0DE09 #04D215 #0D8ECF #0D52D1 #2A0CD0 #8A0CCF #CD0D74 #754DEB #DDDDDD #999999 #333333 #000000 #57032A #CA9726 #990000 #4B0C25".split(" ");this.alpha=1;this.groupPercent=0;this.groupedTitle="Other";this.groupedPulled=!1;this.groupedAlpha=1;this.marginLeft=0;this.marginBottom=this.marginTop=10;this.marginRight=0;this.hoverAlpha=1;this.outlineColor="#FFFFFF";this.outlineAlpha=0;this.outlineThickness=1;this.startAlpha=0;this.startDuration=1;this.startEffect="bounce";this.sequencedAnimation=!0;this.pullOutDuration=1;this.pullOutEffect="bounce";this.pullOnHover=this.pullOutOnlyOne=!1;this.labelsEnabled=!0;this.labelTickColor="#000000";this.labelTickAlpha=0.2;this.hideLabelsPercent=0;this.urlTarget="_self";this.autoMarginOffset=10;this.gradientRatio=[];this.maxLabelWidth=200;this.accessibleLabel="[[title]]: [[percents]]% [[value]] [[description]]";a.applyTheme(this,b,"AmSlicedChart")},initChart:function(){a.AmSlicedChart.base.initChart.call(this);this.dataChanged&&(this.parseData(),this.dispatchDataUpdated=!0,this.dataChanged=!1,this.setLegendData(this.chartData));this.drawChart()},handleLegendEvent:function(f){var e=f.type,j=f.dataItem,i=this.legend;if(j.wedge&&j){var h=j.hidden;f=f.event;switch(e){case"clickMarker":h||i.switchable||this.clickSlice(j,f);break;case"clickLabel":h||this.clickSlice(j,f,!1);break;case"rollOverItem":h||this.rollOverSlice(j,!1,f);break;case"rollOutItem":h||this.rollOutSlice(j,f);break;case"hideItem":this.hideSlice(j,f);break;case"showItem":this.showSlice(j,f)}}},invalidateVisibility:function(){this.recalculatePercents();this.initChart();var b=this.legend;b&&b.invalidateSize()},addEventListeners:function(e,d){var f=this;e.mouseover(function(b){f.rollOverSlice(d,!0,b)}).mouseout(function(b){f.rollOutSlice(d,b)}).touchend(function(b){f.rollOverSlice(d,b)}).mouseup(function(b){f.clickSlice(d,b)}).contextmenu(function(b){f.handleRightClick(d,b)})},formatString:function(f,e,h){f=a.formatValue(f,e,["value"],this.nf,"",this.usePrefixes,this.prefixesOfSmallNumbers,this.prefixesOfBigNumbers);var g=this.pf.precision;isNaN(this.tempPrec)||(this.pf.precision=this.tempPrec);f=a.formatValue(f,e,["percents"],this.pf);f=a.massReplace(f,{"[[title]]":e.title,"[[description]]":e.description});this.pf.precision=g;-1!=f.indexOf("[[")&&(f=a.formatDataContextValue(f,e.dataContext));f=h?a.fixNewLines(f):a.fixBrakes(f);return f=a.cleanFromEmpty(f)},startSlices:function(){var b;for(b=0;b<this.chartData.length;b++){0<this.startDuration&&this.sequencedAnimation?this.setStartTO(b):this.startSlice(this.chartData[b])}},setStartTO:function(d){var c=this;d=setTimeout(function(){c.startSequenced.call(c)},c.startDuration/c.chartData.length*500*d);c.timeOuts.push(d)},pullSlices:function(f){var e=this.chartData,h;for(h=0;h<e.length;h++){var g=e[h];g.pulled&&this.pullSlice(g,1,f)}},startSequenced:function(){var d=this.chartData,c;for(c=0;c<d.length;c++){if(!d[c].started){this.startSlice(this.chartData[c]);break}}},startSlice:function(f){f.started=!0;var e=f.wedge,h=this.startDuration,g=f.labelSet;e&&0<h&&(0<f.alpha&&e.show(),e.translate(f.startX,f.startY),this.animatable.push(e),e.animate({opacity:1,translate:"0,0"},h,this.startEffect));g&&0<h&&(0<f.alpha&&g.show(),g.translate(f.startX,f.startY),g.animate({opacity:1,translate:"0,0"},h,this.startEffect))},showLabels:function(){var f=this.chartData,e;for(e=0;e<f.length;e++){var h=f[e];if(0<h.alpha){var g=h.label;g&&g.show();(h=h.tick)&&h.show()}}},showSlice:function(b){isNaN(b)?b.hidden=!1:this.chartData[b].hidden=!1;this.invalidateVisibility()},hideSlice:function(b){isNaN(b)?b.hidden=!0:this.chartData[b].hidden=!0;this.hideBalloon();this.invalidateVisibility()},rollOverSlice:function(i,e,n){isNaN(i)||(i=this.chartData[i]);clearTimeout(this.hoverInt);if(!i.hidden){this.pullOnHover&&this
|