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