/*
	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.plot2d.Grid"],["require","dojox.charting.Element"],["require","dojox.charting.plot2d.common"],["require","dojox.lang.functional"],["require","dojox.lang.utils"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojox.charting.plot2d.Grid"]){_4._hasResource["dojox.charting.plot2d.Grid"]=true;_4.provide("dojox.charting.plot2d.Grid");_4.require("dojox.charting.Element");_4.require("dojox.charting.plot2d.common");_4.require("dojox.lang.functional");_4.require("dojox.lang.utils");(function(){var du=_6.lang.utils,dc=_6.charting.plot2d.common;_4.declare("dojox.charting.plot2d.Grid",_6.charting.Element,{defaultParams:{hAxis:"x",vAxis:"y",hMajorLines:true,hMinorLines:false,vMajorLines:true,vMinorLines:false,hStripes:"none",vStripes:"none",animate:null},optionalParams:{},constructor:function(_7,_8){this.opt=_4.clone(this.defaultParams);du.updateWithObject(this.opt,_8);this.hAxis=this.opt.hAxis;this.vAxis=this.opt.vAxis;this.dirty=true;this.animate=this.opt.animate;this.zoom=null,this.zoomQueue=[];this.lastWindow={vscale:1,hscale:1,xoffset:0,yoffset:0};},clear:function(){this._hAxis=null;this._vAxis=null;this.dirty=true;return this;},setAxis:function(_9){if(_9){this[_9.vertical?"_vAxis":"_hAxis"]=_9;}return this;},addSeries:function(_a){return this;},getSeriesStats:function(){return _4.delegate(dc.defaultStats);},initializeScalers:function(){return this;},isDirty:function(){return this.dirty||this._hAxis&&this._hAxis.dirty||this._vAxis&&this._vAxis.dirty;},performZoom:function(_b,_c){var vs=this._vAxis.scale||1,hs=this._hAxis.scale||1,_d=_b.height-_c.b,_e=this._hAxis.getScaler().bounds,_f=(_e.from-_e.lower)*_e.scale,_10=this._vAxis.getScaler().bounds,_11=(_10.from-_10.lower)*_10.scale;rVScale=vs/this.lastWindow.vscale,rHScale=hs/this.lastWindow.hscale,rXOffset=(this.lastWindow.xoffset-_f)/((this.lastWindow.hscale==1)?hs:this.lastWindow.hscale),rYOffset=(_11-this.lastWindow.yoffset)/((this.lastWindow.vscale==1)?vs:this.lastWindow.vscale),shape=this.group,anim=_6.gfx.fx.animateTransform(_4.delegate({shape:shape,duration:1200,transform:[{name:"translate",start:[0,0],end:[_c.l*(1-rHScale),_d*(1-rVScale)]},{name:"scale",start:[1,1],end:[rHScale,rVScale]},{name:"original"},{name:"translate",start:[0,0],end:[rXOffset,rYOffset]}]},this.zoom));_4.mixin(this.lastWindow,{vscale:vs,hscale:hs,xoffset:_f,yoffset:_11});this.zoomQueue.push(anim);_4.connect(anim,"onEnd",this,function(){this.zoom=null;this.zoomQueue.shift();if(this.zoomQueue.length>0){this.zoomQueue[0].play();}});if(this.zoomQueue.length==1){this.zoomQueue[0].play();}return this;},getRequiredColors:function(){return 0;},render:function(dim,_12){if(this.zoom){return this.performZoom(dim,_12);}this.dirty=this.isDirty();if(!this.dirty){return this;}this.cleanGroup();var s=this.group,ta=this.chart.theme.axis;try{var _13=this._vAxis.getScaler(),vt=_13.scaler.getTransformerFromModel(_13),_14=this._vAxis.getTicks();if(this.opt.hMinorLines){_4.forEach(_14.minor,function(_15){var y=dim.height-_12.b-vt(_15.value);var _16=s.createLine({x1:_12.l,y1:y,x2:dim.width-_12.r,y2:y}).setStroke(ta.minorTick);if(this.animate){this._animateGrid(_16,"h",_12.l,_12.r+_12.l-dim.width);}},this);}if(this.opt.hMajorLines){_4.forEach(_14.major,function(_17){var y=dim.height-_12.b-vt(_17.value);var _18=s.createLine({x1:_12.l,y1:y,x2:dim.width-_12.r,y2:y}).setStroke(ta.majorTick);if(this.animate){this._animateGrid(_18,"h",_12.l,_12.r+_12.l-dim.width);}},this);}}catch(e){}try{var _19=this._hAxis.getScaler(),ht=_19.scaler.getTransformerFromModel(_19),_14=this._hAxis.getTicks();if(_14&&this.opt.vMinorLines){_4.forEach(_14.minor,function(_1a){var x=_12.l+ht(_1a.value);var _1b=s.createLine({x1:x,y1:_12.t,x2:x,y2:dim.height-_12.b}).setStroke(ta.minorTick);if(this.animate){this._animateGrid(_1b,"v",dim.height-_12.b,dim.height-_12.b-_12.t);}},this);}if(_14&&this.opt.vMajorLines){_4.forEach(_14.major,function(_1c){var x=_12.l+ht(_1c.value);var _1d=s.createLine({x1:x,y1:_12.t,x2:x,y2:dim.height-_12.b}).setStroke(ta.majorTick);if(this.animate){this._animateGrid(_1d,"v",dim.height-_12.b,dim.height-_12.b-_12.t);}},this);}}catch(e){}this.dirty=false;return this;},_animateGrid:function(_1e,_1f,_20,_21){var _22=_1f=="h"?[_20,0]:[0,_20];var _23=_1f=="h"?[1/_21,1]:[1,1/_21];_6.gfx.fx.animateTransform(_4.delegate({shape:_1e,duration:1200,transform:[{name:"translate",start:_22,end:[0,0]},{name:"scale",start:_23,end:[1,1]},{name:"original"}]},this.animate)).play();}});})();}}};});