// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://js.arcgis.com/3.23/esri/copyright.txt for details.
//>>built
define("esri/dijit/geoenrichment/ReportPlayer/core/charts/chartUtils/ChartCalculator",["dojo/_base/lang","dojo/dom-geometry","dojo/dom-style","./ChartTypes","esri/dijit/geoenrichment/utils/DomUtil"],function(z,A,e,q,u){return{calcChartDimentions:function(b,g){var c=g.visualProps,v=g.comparisonInfo,d=g.chartType,a=g.maxIconSize,k=c.width,f=c.height,t=0,w=0,x=0,l,m,n,r,y=!u.isHidden(b.chartLabel),p=0;q.isColumnLike(d)&&!c.xAxis.show&&c.showAxisIcons&&(f+=30);y&&(p=e.get(b.chartLabel,"height"),f-=p);
c.showAxisIcons&&(q.isColumnLike(d)?f-=a:q.isBarLike(d)&&(t+=a,k-=a));v&&q.isComparisonEnabled(d)&&(f-=40);var d=c.legend.placement,h="Left"===d||"Right"===d;h||e.set(b.getLegendNode(),{width:k-20+"px"});a=b.legend&&u.position(b.legend.domNode);a=z.mixin({w:0,h:0},a);h||e.set(b.getLegendNode(),{width:""});h=h?f-48:0;a.h=h?Math.min(a.h,h):a.h;a.w+=4;a.h+=20;c=c.legend.placementOffset/100;switch(d){case "Left":k-=a.w;l=5;m=p+f*c;t+=a.w;break;case "Right":k-=a.w;n=10;m=p+f*c;w+=a.w;break;case "Top":f-=
a.h;m=y?p+10:10;n=l=10;x+=a.h;break;case "Bottom":f-=a.h,r=n=l=10,v&&(r+=30)}e.set(b.chartLabel,{marginLeft:"30px",marginRight:"30px"});e.set(b.chartContainerWithAxis,{marginTop:x+"px",marginLeft:t+"px",marginRight:w+"px"});b.legend&&e.set(b.legend.domNode,{maxHeight:h?h+"px":""});e.set(b.getLegendNode(),{left:void 0!==l?l+"px":"",right:void 0!==n?n+"px":"",top:void 0!==m?m+"px":"",bottom:void 0!==r?r+"px":""});return{w:k,h:f}},resizeVisualProperties:function(b,g,c){var e=b.width,d=b.height;b.width=
g;b.height=c;b.floatingTexts&&b.floatingTexts.forEach(function(a){a.style.left*=g/e;a.style.spaceBefore*=c/d});b.floatingIcons&&b.floatingIcons.forEach(function(a){a.style.left*=g/e;a.style.spaceBefore*=c/d})}}});