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