//>>built
define("dojox/charting/plot2d/commonStacked",["dojo/_base/lang","./common"],function(h,j){var i=h.getObject("dojox.charting.plot2d.commonStacked",!0);return h.mixin(i,{collectStats:function(f){for(var d=h.delegate(j.defaultStats),e=0;e<f.length;++e)for(var b=f[e],a=0;a<b.data.length;a++){var c,g;if(null!==b.data[a])"number"==typeof b.data[a]||!b.data[a].hasOwnProperty("x")?(g=i.getIndexValue(f,e,a),c=a+1):(c=b.data[a].x,null!==c&&(g=i.getValue(f,e,c),g=null!=g&&g.y?g.y:null)),d.hmin=Math.min(d.hmin,
c),d.hmax=Math.max(d.hmax,c),d.vmin=Math.min(d.vmin,g),d.vmax=Math.max(d.vmax,g)}return d},getIndexValue:function(f,d,e){var b=0,a,c;for(c=0;c<=d;++c)a=f[c].data[e],null!=a&&(isNaN(a)&&(a=a.y||0),b+=a);return b},getValue:function(f,d,e){var b=null,a,c;for(a=0;a<=d;++a)for(c=0;c<f[a].data.length;c++)if(v=f[a].data[c],null!==v)if(v.x==e){b||(b={x:e});if(null!=v.y){if(null==b.y)b.y=0;b.y+=v.y}break}else if(v.x>e)break;return b}})});