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