//>>built
define("dojox/charting/plot2d/Grid","dojo/_base/lang,dojo/_base/declare,dojo/_base/connect,dojo/_base/array,./CartesianBase,./common,dojox/lang/utils,dojox/gfx/fx".split(","),function(j,n,r,l,o,p,k,q){return n("dojox.charting.plot2d.Grid",o,{defaultParams:{hAxis:"x",vAxis:"y",hMajorLines:!0,hMinorLines:!1,vMajorLines:!0,vMinorLines:!1,hStripes:!1,vStripes:!1,animate:null,enableCache:!1,renderOnAxis:!0},optionalParams:{majorHLine:{},minorHLine:{},majorVLine:{},minorVLine:{}},constructor:function(c,
a){this.opt=j.clone(this.defaultParams);k.updateWithObject(this.opt,a);k.updateWithPattern(this.opt,a,this.optionalParams);this.hAxis=this.opt.hAxis;this.vAxis=this.opt.vAxis;this.animate=this.opt.animate;if(this.opt.enableCache)this._lineFreePool=[],this._lineUsePool=[]},addSeries:function(){return this},getSeriesStats:function(){return j.delegate(p.defaultStats)},cleanGroup:function(){this.inherited(arguments);if(this.opt.enableCache)this._lineFreePool=this._lineFreePool.concat(this._lineUsePool),
this._lineUsePool=[]},createLine:function(c,a){var e;this.opt.enableCache&&0<this._lineFreePool.length?(e=this._lineFreePool.pop(),e.setShape(a),c.add(e)):e=c.createLine(a);this.opt.enableCache&&this._lineUsePool.push(e);return e},render:function(c,a){if(this.zoom)return this.performZoom(c,a);this.dirty=this.isDirty();if(!this.dirty)return this;this.cleanGroup();var e=this.group,d=this.chart.theme,g,m=this.opt.renderOnAxis;if(this._vAxis){var h=this._vAxis.getScaler();if(h){var j=h.scaler.getTransformerFromModel(h),
f;f=this._vAxis.getTicks();null!=f&&(this.opt.hMinorLines&&(g=this.opt.minorHLine||d.grid&&d.grid.minorLine||d.axis.minorTick,l.forEach(f.minor,function(b){if(m||b.value!=(this._vAxis.opt.leftBottom?h.bounds.from:h.bounds.to))b=c.height-a.b-j(b.value),b=this.createLine(e,{x1:a.l,y1:b,x2:c.width-a.r,y2:b}).setStroke(g),this.animate&&this._animateGrid(b,"h",a.l,a.r+a.l-c.width)},this)),this.opt.hMajorLines&&(g=this.opt.majorHLine||d.grid&&d.grid.majorLine||d.axis.majorTick,l.forEach(f.major,function(b){if(m||
b.value!=(this._vAxis.opt.leftBottom?h.bounds.from:h.bounds.to))b=c.height-a.b-j(b.value),b=this.createLine(e,{x1:a.l,y1:b,x2:c.width-a.r,y2:b}).setStroke(g),this.animate&&this._animateGrid(b,"h",a.l,a.r+a.l-c.width)},this)))}}if(this._hAxis){var i=this._hAxis.getScaler();if(i){var k=i.scaler.getTransformerFromModel(i);f=this._hAxis.getTicks();null!=this&&(f&&this.opt.vMinorLines&&(g=this.opt.minorVLine||d.grid&&d.grid.minorLine||d.axis.minorTick,l.forEach(f.minor,function(b){if(m||b.value!=(this._hAxis.opt.leftBottom?
i.bounds.from:i.bounds.to))b=a.l+k(b.value),b=this.createLine(e,{x1:b,y1:a.t,x2:b,y2:c.height-a.b}).setStroke(g),this.animate&&this._animateGrid(b,"v",c.height-a.b,c.height-a.b-a.t)},this)),f&&this.opt.vMajorLines&&(g=this.opt.majorVLine||d.grid&&d.grid.majorLine||d.axis.majorTick,l.forEach(f.major,function(b){if(m||b.value!=(this._hAxis.opt.leftBottom?i.bounds.from:i.bounds.to))b=a.l+k(b.value),b=this.createLine(e,{x1:b,y1:a.t,x2:b,y2:c.height-a.b}).setStroke(g),this.animate&&this._animateGrid(b,
"v",c.height-a.b,c.height-a.b-a.t)},this)))}}this.dirty=!1;return this},_animateGrid:function(c,a,e,d){q.animateTransform(j.delegate({shape:c,duration:1200,transform:[{name:"translate",start:"h"==a?[e,0]:[0,e],end:[0,0]},{name:"scale",start:"h"==a?[1/d,1]:[1,1/d],end:[1,1]},{name:"original"}]},this.animate)).play()}})});