1
2
3
4
5
6
7
8
9
10
11
| //>>built
| define("dojo/_base/lang dojo/_base/declare dojo/_base/array dojo/sniff ./CartesianBase ./common dojox/lang/utils dojox/gfx/fx".split(" "),function(n,t,p,m,u,v,q,w){var r=function(a,d){return a.value-d.value};return t("dojox.charting.plot2d.Grid",u,{defaultParams:{hMajorLines:!0,hMinorLines:!1,vMajorLines:!0,vMinorLines:!1,hStripes:!1,vStripes:!1,animate:null,enableCache:!1,renderOnAxis:!0},optionalParams:{majorHLine:{},minorHLine:{},majorVLine:{},minorVLine:{},hFill:{},vFill:{},hAlternateFill:{},
| vAlternateFill:{}},constructor:function(a,d){this.opt=n.clone(this.defaultParams);q.updateWithObject(this.opt,d);q.updateWithPattern(this.opt,d,this.optionalParams);this.animate=this.opt.animate;this.opt.enableCache&&(this._lineFreePool=[],this._lineUsePool=[],this._rectFreePool=[],this._rectUsePool=[])},addSeries:function(a){return this},getSeriesStats:function(){return n.delegate(v.defaultStats)},cleanGroup:function(){this.inherited(arguments);this.opt.enableCache&&(this._lineFreePool=this._lineFreePool.concat(this._lineUsePool),
| this._lineUsePool=[],this._rectFreePool=this._rectFreePool.concat(this._rectUsePool),this._rectUsePool=[])},createLine:function(a,d){var c;this.opt.enableCache&&0<this._lineFreePool.length?(c=this._lineFreePool.pop(),c.setShape(d),a.add(c)):c=a.createLine(d);this.opt.enableCache&&this._lineUsePool.push(c);return c},createRect:function(a,d){var c;this.opt.enableCache&&0<this._rectFreePool.length?(c=this._rectFreePool.pop(),c.setShape(d),a.add(c)):c=a.createRect(d);this.opt.enableCache&&this._rectUsePool.push(c);
| return c},render:function(a,d){if(this.zoom)return this.performZoom(a,d);this.dirty=this.isDirty();if(!this.dirty)return this;this.cleanGroup();var c=this.getGroup(),b=this.chart.theme,e;(m("ios")&&6>m("ios")||m("safari")&&!m("ios"))&&c.createRect({x:d.l,y:d.t,width:Math.max(0,a.width-d.l-d.r),height:Math.max(0,a.height-d.t-d.b)});if(this._vAxis){e=this._vAxis.getTicks();var g=this._vAxis.getScaler();if(null!=e&&null!=g){var f=g.scaler.getTransformerFromModel(g);this.opt.hStripes&&this._renderHRect(e,
| b.grid,a,d,g,f);this.opt.hMinorLines&&(c=this.opt.minorHLine||b.grid&&b.grid.minorLine||b.axis.minorTick,this._renderHLines(e.minor,c,a,d,g,f));this.opt.hMajorLines&&(c=this.opt.majorHLine||b.grid&&b.grid.majorLine||b.axis.majorTick,this._renderHLines(e.major,c,a,d,g,f))}}this._hAxis&&(e=this._hAxis.getTicks(),g=this._hAxis.getScaler(),null!=e&&null!=g&&(f=g.scaler.getTransformerFromModel(g),this.opt.vStripes&&this._renderVRect(e,b.grid,a,d,g,f),e&&this.opt.vMinorLines&&(c=this.opt.minorVLine||b.grid&&
| b.grid.minorLine||b.axis.minorTick,this._renderVLines(e.minor,c,a,d,g,f)),e&&this.opt.vMajorLines&&(c=this.opt.majorVLine||b.grid&&b.grid.majorLine||b.axis.majorTick,this._renderVLines(e.major,c,a,d,g,f))));this.dirty=!1;return this},_renderHLines:function(a,d,c,b,e,g){var f=this.getGroup();p.forEach(a,function(a){if(this.opt.renderOnAxis||a.value!=(this._vAxis.opt.leftBottom?e.bounds.from:e.bounds.to))a=c.height-b.b-g(a.value),a=this.createLine(f,{x1:b.l,y1:a,x2:c.width-b.r,y2:a}).setStroke(d),this.animate&&
| this._animateGrid(a,"h",b.l,b.r+b.l-c.width)},this)},_renderVLines:function(a,d,c,b,e,g){var f=this.getGroup();p.forEach(a,function(a){if(this.opt.renderOnAxis||a.value!=(this._hAxis.opt.leftBottom?e.bounds.from:e.bounds.to))a=b.l+g(a.value),a=this.createLine(f,{x1:a,y1:b.t,x2:a,y2:c.height-b.b}).setStroke(d),this.animate&&this._animateGrid(a,"v",c.height-b.b,c.height-b.b-b.t)},this)},_renderHRect:function(a,d,c,b,e,g){var f,k,l;a=a.major.concat(a.minor);a.sort(r);a[0].value>e.bounds.from&&a.splice(0,
| 0,{value:e.bounds.from});a[a.length-1].value<e.bounds.to&&a.push({value:e.bounds.to});e=this.getGroup();for(var h=0;h<a.length-1;h++)if(f=a[h],k=c.height-b.b-g(f.value),l=c.height-b.b-g(a[h+1].value),f=0==h%2?this.opt.hAlternateFill||d&&d.alternateFill:this.opt.hFill||d&&d.fill)f=this.createRect(e,{x:b.l,y:k,width:c.width-b.r,height:k-l}).setFill(f),this.animate&&this._animateGrid(f,"h",b.l,b.r+b.l-c.width)},_renderVRect:function(a,d,c,b,e,g){var f,k,l;a=a.major.concat(a.minor);a.sort(r);a[0].value>
| e.bounds.from&&a.splice(0,0,{value:e.bounds.from});a[a.length-1].value<e.bounds.to&&a.push({value:e.bounds.to});e=this.getGroup();for(var h=0;h<a.length-1;h++)if(f=a[h],k=b.l+g(f.value),l=b.l+g(a[h+1].value),f=0==h%2?this.opt.vAlternateFill||d&&d.alternateFill:this.opt.vFill||d&&d.fill)f=this.createRect(e,{x:k,y:b.t,width:l-k,height:c.width-b.r}).setFill(f),this.animate&&this._animateGrid(f,"v",c.height-b.b,c.height-b.b-b.t)},_animateGrid:function(a,d,c,b){w.animateTransform(n.delegate({shape:a,duration:1200,
| transform:[{name:"translate",start:"h"==d?[c,0]:[0,c],end:[0,0]},{name:"scale",start:"h"==d?[1/b,1]:[1,1/b],end:[1,1]},{name:"original"}]},this.animate)).play()}})});
|
|