//>>built
define("dojox/charting/plot2d/Columns","dojo/_base/lang,dojo/_base/array,dojo/_base/declare,./CartesianBase,./_PlotEvents,./common,dojox/lang/functional,dojox/lang/functional/reversed,dojox/lang/utils,dojox/gfx/fx".split(","),function(r,v,s,t,z,n,A,B,l,C){var D=B.lambda("item.purgeGroup()");return s("dojox.charting.plot2d.Columns",[t,z],{defaultParams:{hAxis:"x",vAxis:"y",gap:0,animate:null,enableCache:!1},optionalParams:{minBarSize:1,maxBarSize:1,stroke:{},outline:{},shadow:{},fill:{},styleFunc:null,
font:"",fontColor:""},constructor:function(a,d){this.opt=r.clone(this.defaultParams);l.updateWithObject(this.opt,d);l.updateWithPattern(this.opt,d,this.optionalParams);this.series=[];this.hAxis=this.opt.hAxis;this.vAxis=this.opt.vAxis;this.animate=this.opt.animate},getSeriesStats:function(){var a=n.collectSimpleStats(this.series);a.hmin-=0.5;a.hmax+=0.5;return a},createRect:function(a,d,e){var f;this.opt.enableCache&&0<a._rectFreePool.length?(f=a._rectFreePool.pop(),f.setShape(e),d.add(f)):f=d.createRect(e);
this.opt.enableCache&&a._rectUsePool.push(f);return f},render:function(a,d){if(this.zoom&&!this.isDataDirty())return this.performZoom(a,d);this.getSeriesStats();this.resetEvents();this.dirty=this.isDirty();var e;if(this.dirty)v.forEach(this.series,D),this._eventSeries={},this.cleanGroup(),e=this.group,A.forEachRev(this.series,function(a){a.cleanGroup(e)});for(var f=this.chart.theme,n=this._hScaler.scaler.getTransformerFromModel(this._hScaler),l=this._vScaler.scaler.getTransformerFromModel(this._vScaler),
w=Math.max(0,this._vScaler.bounds.lower),o=l(w),s=this.events(),p=this.getBarProperties(),m=this.series.length-1;0<=m;--m){var b=this.series[m];if(!this.dirty&&!b.dirty)f.skip(),this._reconnectEvents(b.name);else{b.cleanGroup();if(this.opt.enableCache)b._rectFreePool=(b._rectFreePool?b._rectFreePool:[]).concat(b._rectUsePool?b._rectUsePool:[]),b._rectUsePool=[];var x=f.next("column",[this.opt,b]),y=Array(b.data.length);e=b.group;for(var u=v.some(b.data,function(a){return"number"==typeof a||a&&!a.hasOwnProperty("x")}),
i=u?Math.max(0,Math.floor(this._hScaler.bounds.from-1)):0,t=u?Math.min(b.data.length,Math.ceil(this._hScaler.bounds.to)):b.data.length;i<t;++i){var c=b.data[i];if(null!=c){var h=this.getValue(c,i,m,u),j=l(h.y),q=Math.abs(j-o),g;if(this.opt.styleFunc||"number"!=typeof c){var k="number"!=typeof c?[c]:[];this.opt.styleFunc&&k.push(this.opt.styleFunc(c));c=f.addMixin(x,"column",k,!0)}else c=f.post(x,"column");if(1<=p.width&&0<=q)j={x:d.l+n(h.x+0.5)+p.gap+p.thickness*m,y:a.height-d.b-(h.y>w?j:o),width:p.width,
height:q},c.series.shadow&&(g=r.clone(j),g.x+=c.series.shadow.dx,g.y+=c.series.shadow.dy,g=this.createRect(b,e,g).setFill(c.series.shadow.color).setStroke(c.series.shadow),this.animate&&this._animateColumn(g,a.height-d.b+o,q)),k=this._plotFill(c.series.fill,a,d),k=this._shapeFill(k,j),c=this.createRect(b,e,j).setFill(k).setStroke(c.series.stroke),b.dyn.fill=c.getFill(),b.dyn.stroke=c.getStroke(),s&&(h={element:"column",index:i,run:b,shape:c,shadow:g,x:h.x+0.5,y:h.y},this._connectEvents(h),y[i]=h),
this.animate&&this._animateColumn(c,a.height-d.b-o,q)}}this._eventSeries[b.name]=y;b.dirty=!1}}this.dirty=!1;return this},getValue:function(a,d,e,f){f?(e="number"==typeof a?a:a.y,a=d):(e=a.y,a=a.x-1);return{y:e,x:a}},getBarProperties:function(){var a=n.calculateBarSize(this._hScaler.bounds.scale,this.opt);return{gap:a.gap,width:a.size,thickness:0}},_animateColumn:function(a,d,e){0==e&&(e=1);C.animateTransform(r.delegate({shape:a,duration:1200,transform:[{name:"translate",start:[0,d-d/e],end:[0,0]},
{name:"scale",start:[1,1/e],end:[1,1]},{name:"original"}]},this.animate)).play()}})});