/*
	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.geo.charting.widget.Legend"],["require","dijit._Widget"],["require","dijit._Templated"],["require","dojox.lang.functional.array"],["require","dojox.lang.functional.fold"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojox.geo.charting.widget.Legend"]){_4._hasResource["dojox.geo.charting.widget.Legend"]=true;_4.provide("dojox.geo.charting.widget.Legend");_4.require("dijit._Widget");_4.require("dijit._Templated");_4.require("dojox.lang.functional.array");_4.require("dojox.lang.functional.fold");_4.declare("dojox.geo.charting.widget.Legend",[_5._Widget,_5._Templated],{templateString:"<table dojoAttachPoint='legendNode' class='dojoxLegendNode'><tbody dojoAttachPoint='legendBody'></tbody></table>",horizontal:true,legendNode:null,legendBody:null,swatchSize:18,postCreate:function(){if(!this.map){return;}this.series=this.map.series;_4.byId(this.map.container).appendChild(this.domNode);this.refresh();},refresh:function(){while(this.legendBody.lastChild){_4.destroy(this.legendBody.lastChild);}if(this.horizontal){_4.addClass(this.legendNode,"dojoxLegendHorizontal");this._tr=_4.doc.createElement("tr");this.legendBody.appendChild(this._tr);}var s=this.series;if(s.length==0){return;}_4.forEach(s,function(x){this._addLabel(x.color,x.name);},this);},_addLabel:function(_7,_8){var _9=_4.doc.createElement("td");var _a=_4.doc.createElement("td");var _b=_4.doc.createElement("div");_4.addClass(_9,"dojoxLegendIcon");_4.addClass(_a,"dojoxLegendText");_b.style.width=this.swatchSize+"px";_b.style.height=this.swatchSize+"px";_9.appendChild(_b);if(this.horizontal){this._tr.appendChild(_9);this._tr.appendChild(_a);}else{var tr=_4.doc.createElement("tr");this.legendBody.appendChild(tr);tr.appendChild(_9);tr.appendChild(_a);}_b.style.background=_7;_a.innerHTML=String(_8);}});}}};});