//>>built
define("dojox/charting/Element","dojo/_base/lang,dojo/_base/array,dojo/dom-construct,dojo/_base/declare,dojox/gfx,dojox/gfx/shape".split(","),function(l,j,h,k,f,i){return k("dojox.charting.Element",null,{chart:null,group:null,htmlElements:null,dirty:!0,constructor:function(a){this.chart=a;this.group=null;this.htmlElements=[];this.dirty=!0;this.trailingSymbol="...";this._events=[]},purgeGroup:function(){this.destroyHtmlElements();if(this.group){this.group.removeShape();for(var a=this.group.children,
d=0;d<a.length;++d)i.dispose(a[d],!0);this.group.rawNode&&h.empty(this.group.rawNode);this.group.clear();i.dispose(this.group,!0);this.group=null}this.dirty=!0;if(this._events.length)j.forEach(this._events,function(a){a.shape.disconnect(a.handle)}),this._events=[];return this},cleanGroup:function(a){this.destroyHtmlElements();if(!a)a=this.chart.surface;if(this.group){for(var d,a=this.group.children,b=0;b<a.length;++b)i.dispose(a[b],!0);if(this.group.rawNode)d=this.group.bgNode,h.empty(this.group.rawNode);
this.group.clear();d&&this.group.rawNode.appendChild(d)}else this.group=a.createGroup();this.dirty=!0;return this},destroyHtmlElements:function(){if(this.htmlElements.length)j.forEach(this.htmlElements,h.destroy),this.htmlElements=[]},destroy:function(){this.purgeGroup()},getTextWidth:function(a,d){return f._base._getTextBox(a,{font:d}).w||0},getTextWithLimitLength:function(a,d,b,c){if(!a||0>=a.length)return{text:"",truncated:c||!1};if(!b||0>=b)return{text:a,truncated:c||!1};var e=a.substring(0,1)+
this.trailingSymbol,f=this.getTextWidth(e,d);if(b<=f)return{text:e,truncated:!0};if(this.getTextWidth(a,d)<=b)return{text:a,truncated:c||!1};c=0;for(e=a.length;c<e;){if(2>=e-c){for(;this.getTextWidth(a.substring(0,c)+this.trailingSymbol,d)>b;)c-=1;return{text:a.substring(0,c)+this.trailingSymbol,truncated:!0}}f=c+Math.round(0.618*(e-c));this.getTextWidth(a.substring(0,f),d)<b?c=f:e=f}},getTextWithLimitCharCount:function(a,d,b,c){return!a||0>=a.length?{text:"",truncated:c||!1}:!b||0>=b||a.length<=
b?{text:a,truncated:c||!1}:{text:a.substring(0,b)+this.trailingSymbol,truncated:!0}},_plotFill:function(a,d,b){if(!a||!a.type||!a.space)return a;var c=a.space,e;switch(a.type){case "linear":if("plot"===c||"shapeX"===c||"shapeY"===c){a=f.makeParameters(f.defaultLinearGradient,a);a.space=c;if("plot"===c||"shapeX"===c)e=d.height-b.t-b.b,a.y1=b.t+e*a.y1/100,a.y2=b.t+e*a.y2/100;if("plot"===c||"shapeY"===c)e=d.width-b.l-b.r,a.x1=b.l+e*a.x1/100,a.x2=b.l+e*a.x2/100}break;case "radial":if("plot"===c)a=f.makeParameters(f.defaultRadialGradient,
a),a.space=c,c=d.width-b.l-b.r,d=d.height-b.t-b.b,a.cx=b.l+c*a.cx/100,a.cy=b.t+d*a.cy/100,a.r=a.r*Math.sqrt(c*c+d*d)/200;break;case "pattern":if("plot"===c||"shapeX"===c||"shapeY"===c){a=f.makeParameters(f.defaultPattern,a);a.space=c;if("plot"===c||"shapeX"===c)e=d.height-b.t-b.b,a.y=b.t+e*a.y/100,a.height=e*a.height/100;if("plot"===c||"shapeY"===c)e=d.width-b.l-b.r,a.x=b.l+e*a.x/100,a.width=e*a.width/100}}return a},_shapeFill:function(a,d){if(!a||!a.space)return a;var b=a.space,c;switch(a.type){case "linear":if("shape"===
b||"shapeX"===b||"shapeY"===b){a=f.makeParameters(f.defaultLinearGradient,a);a.space=b;if("shape"===b||"shapeX"===b)c=d.width,a.x1=d.x+c*a.x1/100,a.x2=d.x+c*a.x2/100;if("shape"===b||"shapeY"===b)c=d.height,a.y1=d.y+c*a.y1/100,a.y2=d.y+c*a.y2/100}break;case "radial":if("shape"===b)a=f.makeParameters(f.defaultRadialGradient,a),a.space=b,a.cx=d.x+d.width/2,a.cy=d.y+d.height/2,a.r=a.r*d.width/200;break;case "pattern":if("shape"===b||"shapeX"===b||"shapeY"===b){a=f.makeParameters(f.defaultPattern,a);a.space=
b;if("shape"===b||"shapeX"===b)c=d.width,a.x=d.x+c*a.x/100,a.width=c*a.width/100;if("shape"===b||"shapeY"===b)c=d.height,a.y=d.y+c*a.y/100,a.height=c*a.height/100}}return a},_pseudoRadialFill:function(a,d,b,c,e){if(!a||"radial"!==a.type||"shape"!==a.space)return a;var g=a.space,a=f.makeParameters(f.defaultRadialGradient,a);a.space=g;if(4>arguments.length)return a.cx=d.x,a.cy=d.y,a.r=a.r*b/100,a;g=5>arguments.length?c:(e+c)/2;return{type:"linear",x1:d.x,y1:d.y,x2:d.x+a.r*b*Math.cos(g)/100,y2:d.y+a.r*
b*Math.sin(g)/100,colors:a.colors}}})});