// 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/plots/_ClusteredBarsBase","dojo/_base/lang dojo/_base/array dojo/_base/declare dojo/has dojox/charting/plot2d/CartesianBase dojox/charting/plot2d/_PlotEvents dojox/charting/plot2d/common dojox/lang/utils dojox/lang/functional dojox/lang/functional/reversed ./labelsRendering/_BarsLabelRenderingFix ./animation/_ClusteredBarsAnimation ./_MinVisibleBar".split(" "),function(n,p,y,F,G,H,t,m,I,J,K,L,M){var N=J.lambda("item.purgeGroup()");
return y("dojox.charting.plot2d.Bars",[G,H,K,L,M],{_animationInfos:null,defaultParams:{gap:0,animate:null,enableCache:!1},optionalParams:{minBarSize:1,maxBarSize:1,stroke:{},outline:{},shadow:{},fill:{},filter:{},styleFunc:null,font:"",fontColor:"",labelHorizontalAlign:null},constructor:function(a,c){this.opt=n.clone(n.mixin(this.opt,this.defaultParams));m.updateWithObject(this.opt,c);m.updateWithPattern(this.opt,c,this.optionalParams);this.animate=this.opt.animate;this.renderingOptions={"shape-rendering":"crispEdges"}},
getSeriesStats:function(){var a=t.collectSimpleStats(this.series,function(a){return null==a}),c;a.hmin-=.5;a.hmax+=.5;c=a.hmin;a.hmin=a.vmin;a.vmin=c;c=a.hmax;a.hmax=a.vmax;a.vmax=c;return a},render:function(a,c){if(this.zoom&&!this.isDataDirty())return this.performZoom(a,c);this.dirty=this.isDirty();this.resetEvents();var e;this.dirty&&(p.forEach(this.series,N),this._eventSeries={},this.cleanGroup(),e=this.getGroup(),I.forEachRev(this.series,function(a){a.cleanGroup(e)}));var k=this.chart.theme,
u=this._hScaler.scaler.getTransformerFromModel(this._hScaler),n=this._vScaler.scaler.getTransformerFromModel(this._vScaler),z=Math.max(0,this._hScaler.bounds.lower),A=u(z),t=this.events(),v=this.getBarProperties(),B=this.series.length;p.forEach(this.series,function(a){a.hidden&&B--});var m=B;this._animationInfos=[];for(var w=this.series.length-1;0<=w;--w){var b=this.series[w];if(this.dirty||b.dirty){b.cleanGroup();this.opt.enableCache&&(b._rectFreePool=(b._rectFreePool?b._rectFreePool:[]).concat(b._rectUsePool?
b._rectUsePool:[]),b._rectUsePool=[]);var x=k.next("bar",[this.opt,b]);if(b.hidden)b.dyn.fill=x.series.fill,b.dyn.stroke=x.series.stroke;else{m--;var D=Array(b.data.length);e=b.group;for(var q=p.some(b.data,function(a){return"number"===typeof a||a&&!a.hasOwnProperty("x")}),y=q?Math.min(b.data.length,Math.ceil(this._vScaler.bounds.to)):b.data.length,f=q?Math.max(0,Math.floor(this._vScaler.bounds.from-1)):0;f<y;++f){var d=b.data[f];if(null!=d){var h=this.getValue(d,f,w,q),r=u(h.y),C=Math.abs(r-A),l;
this.opt.styleFunc||"number"!==typeof d?(l="number"!==typeof d?[d]:[],this.opt.styleFunc&&l.push(this.opt.styleFunc(d)),l=k.addMixin(x,"bar",l,!0)):l=k.post(x,"bar");if(0<=C&&1<=v.height){var g={x:c.l+(h.y<z?r:A),y:a.height-c.b-n(h.x+1.5)+v.gap+v.thickness*(B-m-1),width:C,height:v.height},g=this._drawBar(e,d,g,l,a,c,b),r=g.shape,g=g.rect;if(t){var E={element:"bar",index:f,run:b,shape:r,cx:h.y,cy:h.x+1.5,x:q?f:b.data[f].x,y:q?b.data[f]:b.data[f].y};this._connectEvents(E);D[f]=E}!isNaN(h.py)&&h.py>
z&&(g.x+=u(h.py),g.width-=u(h.py));this.createLabel(e,d,g,l,a,c);this.animate&&(d={shape:r,hoffset:c.l+A,hsize:-C},this._animationInfos.push(d),this._animateBar(d))}}}this._eventSeries[b.name]=D;b.dirty=!1}}else k.skip(),this._reconnectEvents(b.name)}this.dirty=!1;F("dojo-bidi")&&this._checkOrientation(this.group,a,c);return this},_drawBar:function(a,c,e,k,m,n,p){},getValue:function(a,c,e,k){k?(e="number"===typeof a?a:a.y,a=c):(e=a.y,a=a.x-1);return{y:e,x:a}},getBarProperties:function(){var a=this.series.length;
p.forEach(this.series,function(c){c.hidden&&a--});var c=t.calculateBarSize(this._vScaler.bounds.scale,this.opt,a);return{gap:c.gap,height:c.size,thickness:c.size}}})});