//>>built
define("dojox/charting/plot2d/common","dojo/_base/lang dojo/_base/array dojo/_base/Color dojox/gfx dojox/lang/functional ../scaler/common".split(" "),function(u,v,t,w,y,x){var r=u.getObject("dojox.charting.plot2d.common",!0);return u.mixin(r,{doIfLoaded:x.doIfLoaded,makeStroke:function(d){if(!d)return d;if("string"==typeof d||d instanceof t)d={color:d};return w.makeParameters(w.defaultStroke,d)},augmentColor:function(d,b){var a=new t(d),c=new t(b);c.a=a.a;return c},augmentStroke:function(d,b){var a=
r.makeStroke(d);a&&(a.color=r.augmentColor(a.color,b));return a},augmentFill:function(d,b){new t(b);return"string"==typeof d||d instanceof t?r.augmentColor(d,b):d},defaultStats:{vmin:Number.POSITIVE_INFINITY,vmax:Number.NEGATIVE_INFINITY,hmin:Number.POSITIVE_INFINITY,hmax:Number.NEGATIVE_INFINITY},collectSimpleStats:function(d,b){for(var a=u.delegate(r.defaultStats),c=0;c<d.length;++c)for(var f=d[c],e=0;e<f.data.length;e++)if(!b(f.data[e])){if("number"==typeof f.data[e]){e=a.vmin;var g=a.vmax;v.forEach(f.data,
function(h,k){if(!b(h)){var l=k+1,m=h;isNaN(m)&&(m=0);a.hmin=Math.min(a.hmin,l);a.hmax=Math.max(a.hmax,l);a.vmin=Math.min(a.vmin,m);a.vmax=Math.max(a.vmax,m)}})}else{var n=a.hmin,p=a.hmax;e=a.vmin;g=a.vmax;"xmin"in f&&"xmax"in f&&"ymin"in f&&"ymax"in f||v.forEach(f.data,function(h,k){if(!b(h)){var l="x"in h?h.x:k+1,m=h.y;isNaN(l)&&(l=0);isNaN(m)&&(m=0);a.hmin=Math.min(a.hmin,l);a.hmax=Math.max(a.hmax,l);a.vmin=Math.min(a.vmin,m);a.vmax=Math.max(a.vmax,m)}});"xmin"in f&&(a.hmin=Math.min(n,f.xmin));
"xmax"in f&&(a.hmax=Math.max(p,f.xmax))}"ymin"in f&&(a.vmin=Math.min(e,f.ymin));"ymax"in f&&(a.vmax=Math.max(g,f.ymax));break}return a},calculateBarSize:function(d,b,a){a||(a=1);var c=(d-2*b.gap)/a;"minBarSize"in b&&(c=Math.max(c,b.minBarSize));"maxBarSize"in b&&(c=Math.min(c,b.maxBarSize));c=Math.max(c,1);return{size:c,gap:(d-c*a)/2}},collectStackedStats:function(d){var b=u.clone(r.defaultStats);if(d.length){b.hmin=Math.min(b.hmin,1);b.hmax=y.foldl(d,"seed, run -\x3e Math.max(seed, run.data.length)",
b.hmax);for(var a=0;a<b.hmax;++a){var c=d[0].data[a];c=c&&("number"==typeof c?c:c.y);isNaN(c)&&(c=0);b.vmin=Math.min(b.vmin,c);for(var f=1;f<d.length;++f){var e=d[f].data[a];e=e&&("number"==typeof e?e:e.y);isNaN(e)&&(e=0);c+=e}b.vmax=Math.max(b.vmax,c)}}return b},curve:function(d,b){var a=d.slice(0);"x"==b&&(a[a.length]=a[0]);return v.map(a,function(c,f){if(0==f)return"M"+c.x+","+c.y;if(!isNaN(b)){var e=c.x-a[f-1].x;return"C"+(c.x-e/b*(b-1))+","+a[f-1].y+" "+(c.x-e/b)+","+c.y+" "+c.x+","+c.y}if("X"==
b||"x"==b||"S"==b){var g=a[f-1];e=a[f];var n=1/6;if(1==f){var p="x"==b?a[a.length-2]:g;n=1/3}else p=a[f-2];if(f==a.length-1){var h="x"==b?a[1]:e;n=1/3}else h=a[f+1];var k=Math.sqrt((e.x-g.x)*(e.x-g.x)+(e.y-g.y)*(e.y-g.y));var l=Math.sqrt((e.x-p.x)*(e.x-p.x)+(e.y-p.y)*(e.y-p.y));var m=Math.sqrt((h.x-g.x)*(h.x-g.x)+(h.y-g.y)*(h.y-g.y)),q=l*n;n*=m;q>k/2&&n>k/2?(q=k/2,n=k/2):q>k/2?(q=k/2,n=k/2*m/l):n>k/2&&(n=k/2,q=k/2*l/m);"S"==b&&(p==g&&(q=0),e==h&&(n=0));k=g.x+q*(e.x-p.x)/l;p=g.y+q*(e.y-p.y)/l;l=e.x-
n*(h.x-g.x)/m;g=e.y-n*(h.y-g.y)/m}return"C"+(k+","+p+" "+l+","+g+" "+e.x+","+e.y)}).join(" ")},getLabel:function(d,b,a){return x.doIfLoaded("dojo/number",function(c){return(b?c.format(d,{places:a}):c.format(d))||""},function(){return b?d.toFixed(a):d.toString()})},purgeGroup:function(d){return d.purgeGroup()}})});