/*
	Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
	Available via Academic Free License >= 2.1 OR the modified BSD license.
	see: http://dojotoolkit.org/license for details
*/


window[esri._dojoScopeName||"dojo"]._xdResourceLoaded(function(_1,_2,_3){return {depends:[["provide","dojox.charting.action2d.Tooltip"],["require","dijit.Tooltip"],["require","dojox.charting.action2d.Base"],["require","dojox.gfx.matrix"],["require","dojox.lang.functional"],["require","dojox.lang.functional.scan"],["require","dojox.lang.functional.fold"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojox.charting.action2d.Tooltip"]){_4._hasResource["dojox.charting.action2d.Tooltip"]=true;_4.provide("dojox.charting.action2d.Tooltip");_4.require("dijit.Tooltip");_4.require("dojox.charting.action2d.Base");_4.require("dojox.gfx.matrix");_4.require("dojox.lang.functional");_4.require("dojox.lang.functional.scan");_4.require("dojox.lang.functional.fold");(function(){var _7=function(o){var t=o.run&&o.run.data&&o.run.data[o.index];if(t&&typeof t!="number"&&(t.tooltip||t.text)){return t.tooltip||t.text;}if(o.element=="candlestick"){return "<table cellpadding=\"1\" cellspacing=\"0\" border=\"0\" style=\"font-size:0.9em;\">"+"<tr><td>Open:</td><td align=\"right\"><strong>"+o.data.open+"</strong></td></tr>"+"<tr><td>High:</td><td align=\"right\"><strong>"+o.data.high+"</strong></td></tr>"+"<tr><td>Low:</td><td align=\"right\"><strong>"+o.data.low+"</strong></td></tr>"+"<tr><td>Close:</td><td align=\"right\"><strong>"+o.data.close+"</strong></td></tr>"+(o.data.mid!==undefined?"<tr><td>Mid:</td><td align=\"right\"><strong>"+o.data.mid+"</strong></td></tr>":"")+"</table>";}return o.element=="bar"?o.x:o.y;};var df=_6.lang.functional,m=_6.gfx.matrix,_8=Math.PI/4,_9=Math.PI/2;_4.declare("dojox.charting.action2d.Tooltip",_6.charting.action2d.Base,{defaultParams:{text:_7},optionalParams:{},constructor:function(_a,_b,_c){this.text=_c&&_c.text?_c.text:_7;this.connect();},process:function(o){if(o.type==="onplotreset"||o.type==="onmouseout"){_5.hideTooltip(this.aroundRect);this.aroundRect=null;if(o.type==="onplotreset"){delete this.angles;}return;}if(!o.shape||o.type!=="onmouseover"){return;}var _d={type:"rect"},_e=["after","before"];switch(o.element){case "marker":_d.x=o.cx;_d.y=o.cy;_d.width=_d.height=1;break;case "circle":_d.x=o.cx-o.cr;_d.y=o.cy-o.cr;_d.width=_d.height=2*o.cr;break;case "column":_e=["above","below"];case "bar":_d=_4.clone(o.shape.getShape());break;case "candlestick":_d.x=o.x;_d.y=o.y;_d.width=o.width;_d.height=o.height;break;default:if(!this.angles){if(typeof o.run.data[0]=="number"){this.angles=df.map(df.scanl(o.run.data,"+",0),"* 2 * Math.PI / this",df.foldl(o.run.data,"+",0));}else{this.angles=df.map(df.scanl(o.run.data,"a + b.y",0),"* 2 * Math.PI / this",df.foldl(o.run.data,"a + b.y",0));}}var _f=m._degToRad(o.plot.opt.startAngle),_10=(this.angles[o.index]+this.angles[o.index+1])/2+_f;_d.x=o.cx+o.cr*Math.cos(_10);_d.y=o.cy+o.cr*Math.sin(_10);_d.width=_d.height=1;if(_10<_8){}else{if(_10<_9+_8){_e=["below","above"];}else{if(_10<Math.PI+_8){_e=["before","after"];}else{if(_10<2*Math.PI-_8){_e=["above","below"];}}}}break;}var lt=_4.coords(this.chart.node,true);_d.x+=lt.x;_d.y+=lt.y;_d.x=Math.round(_d.x);_d.y=Math.round(_d.y);_d.width=Math.ceil(_d.width);_d.height=Math.ceil(_d.height);this.aroundRect=_d;var _11=this.text(o);if(_11){_5.showTooltip(_11,this.aroundRect,_e);}}});})();}}};});