//>>built
define("dojox/charting/plot2d/Default","dojo/_base/lang dojo/_base/declare dojo/_base/array dojo/has ./CartesianBase ./_PlotEvents ./common dojox/lang/functional dojox/lang/functional/reversed dojox/lang/utils dojox/gfx/fx".split(" "),function(w,F,d,L,M,N,x,O,P,y,Q){var R=P.lambda("item.purgeGroup()");return F("dojox.charting.plot2d.Default",[M,N],{defaultParams:{lines:!0,areas:!1,markers:!1,tension:"",animate:!1,enableCache:!1,interpolate:!1},optionalParams:{stroke:{},outline:{},shadow:{},fill:{},
filter:{},styleFunc:null,font:"",fontColor:"",marker:"",markerStroke:{},markerOutline:{},markerShadow:{},markerFill:{},markerFont:"",markerFontColor:"",zeroLine:0},constructor:function(g,c){this.opt=w.clone(w.mixin(this.opt,this.defaultParams));y.updateWithObject(this.opt,c);y.updateWithPattern(this.opt,c,this.optionalParams);this.animate=this.opt.animate},createPath:function(g,c,b){var h;this.opt.enableCache&&0<g._pathFreePool.length?(h=g._pathFreePool.pop(),h.setShape(b),c.add(h)):h=c.createPath(b);
this.opt.enableCache&&g._pathUsePool.push(h);return h},buildSegments:function(g,c){for(var b=this.series[g],h=c?Math.min(b.data.length,Math.ceil(this._hScaler.bounds.to)):b.data.length,l=null,k=[],d=c?Math.max(0,Math.floor(this._hScaler.bounds.from-1)):0;d<h;d++)if(!this.isNullValue(b.data[d]))l||(l=[],k.push({index:d,rseg:l})),l.push(c&&b.data[d].hasOwnProperty("y")?b.data[d].y:b.data[d]);else if(!this.opt.interpolate||c)l=null;return k},render:function(g,c){if(this.zoom&&!this.isDataDirty())return this.performZoom(g,
c);this.resetEvents();this.dirty=this.isDirty();var b;this.dirty&&(d.forEach(this.series,R),this._eventSeries={},this.cleanGroup(),this.getGroup().setTransform(null),b=this.getGroup(),O.forEachRev(this.series,function(a){a.cleanGroup(b)}));for(var h=this.chart.theme,l,k,y=this.events(),z=0;z<this.series.length;z++){var a=this.series[z];if(this.dirty||a.dirty)if(a.cleanGroup(),this.opt.enableCache&&(a._pathFreePool=(a._pathFreePool?a._pathFreePool:[]).concat(a._pathUsePool?a._pathUsePool:[]),a._pathUsePool=
[]),a.data.length){var f=h.next(this.opt.areas?"area":"line",[this.opt,a],!0),e,G=this._hScaler.scaler.getTransformerFromModel(this._hScaler),A=this._vScaler.scaler.getTransformerFromModel(this._vScaler),F=this._eventSeries[a.name]=Array(a.data.length);b=a.group;if(a.hidden){this.opt.lines&&(a.dyn.stroke=f.series.stroke);if(a.markers||void 0===a.markers&&this.opt.markers)a.dyn.markerFill=f.marker.fill,a.dyn.markerStroke=f.marker.stroke,a.dyn.marker=f.symbol;this.opt.areas&&(a.dyn.fill=f.series.fill)}else{for(var B=
d.some(a.data,function(a){return"number"==typeof a||a&&!a.hasOwnProperty("x")}),C=this.buildSegments(z,B),t=0;t<C.length;t++){var n=C[t];e=B?d.map(n.rseg,function(a,b){return{x:G(b+n.index+1)+c.l,y:g.height-c.b-A(a),data:a}},this):d.map(n.rseg,function(a){return{x:G(a.x)+c.l,y:g.height-c.b-A(a.y),data:a}},this);if(B&&this.opt.interpolate)for(;t<C.length;)t++,(n=C[t])&&(e=e.concat(d.map(n.rseg,function(a,b){return{x:G(b+n.index+1)+c.l,y:g.height-c.b-A(a),data:a}},this)));var p=this.opt.tension?x.curve(e,
this.opt.tension):"";if(this.opt.areas&&1<e.length){var u=this._plotFill(f.series.fill,g,c),q=w.clone(e),v=g.height-c.b;isNaN(this.opt.zeroLine)||(v=Math.max(c.t,Math.min(g.height-c.b-A(this.opt.zeroLine),v)));this.opt.tension?a.dyn.fill=b.createPath(p+" "+("L"+q[q.length-1].x+","+v+" L"+q[0].x+","+v+" L"+q[0].x+","+q[0].y)).setFill(u).getFill():(q.push({x:e[e.length-1].x,y:v}),q.push({x:e[0].x,y:v}),q.push(e[0]),a.dyn.fill=b.createPolyline(q).setFill(u).getFill())}if(this.opt.lines||this.opt.markers)l=
f.series.stroke,f.series.outline&&(k=a.dyn.outline=x.makeStroke(f.series.outline),k.width=2*k.width+(l&&l.width||0));this.opt.markers&&(a.dyn.marker=f.symbol);var D=null,H=null,I=null;if(l&&f.series.shadow&&1<e.length){var r=f.series.shadow,u=d.map(e,function(a){return{x:a.x+r.dx,y:a.y+r.dy}});this.opt.lines&&(a.dyn.shadow=this.opt.tension?b.createPath(x.curve(u,this.opt.tension)).setStroke(r).getStroke():b.createPolyline(u).setStroke(r).getStroke());this.opt.markers&&f.marker.shadow&&(r=f.marker.shadow,
I=d.map(u,function(c){return this.createPath(a,b,"M"+c.x+" "+c.y+" "+f.symbol).setStroke(r).setFill(r.color)},this))}if(this.opt.lines&&1<e.length){var E;k&&(a.dyn.outline=this.opt.tension?b.createPath(p).setStroke(k).getStroke():b.createPolyline(e).setStroke(k).getStroke());a.dyn.stroke=this.opt.tension?(E=b.createPath(p)).setStroke(l).getStroke():(E=b.createPolyline(e)).setStroke(l).getStroke();E.setFilter&&f.series.filter&&E.setFilter(f.series.filter)}p=null;if(this.opt.markers){var m=f,D=Array(e.length),
H=Array(e.length);k=null;m.marker.outline&&(k=x.makeStroke(m.marker.outline),k.width=2*k.width+(m.marker.stroke?m.marker.stroke.width:0));d.forEach(e,function(c,e){if(this.opt.styleFunc||"number"!=typeof c.data){var d="number"!=typeof c.data?[c.data]:[];this.opt.styleFunc&&d.push(this.opt.styleFunc(c.data));m=h.addMixin(f,"marker",d,!0)}else m=h.post(f,"marker");d="M"+c.x+" "+c.y+" "+m.symbol;k&&(H[e]=this.createPath(a,b,d).setStroke(k));D[e]=this.createPath(a,b,d).setStroke(m.marker.stroke).setFill(m.marker.fill)},
this);a.dyn.markerFill=m.marker.fill;a.dyn.markerStroke=m.marker.stroke;!p&&this.opt.labels&&(p=D[0].getBoundingBox());y?d.forEach(D,function(c,b){var d={element:"marker",index:b+n.index,run:a,shape:c,outline:H[b]||null,shadow:I&&I[b]||null,cx:e[b].x,cy:e[b].y};B?(d.x=b+n.index+1,d.y=a.data[b+n.index]):(d.x=n.rseg[b].x,d.y=a.data[b+n.index].y);this._connectEvents(d);F[b+n.index]=d},this):delete this._eventSeries[a.name]}if(this.opt.labels){var J=p?p.width:2,K=p?p.height:2;d.forEach(e,function(a,c){if(this.opt.styleFunc||
"number"!=typeof a.data){var d="number"!=typeof a.data?[a.data]:[];this.opt.styleFunc&&d.push(this.opt.styleFunc(a.data));m=h.addMixin(f,"marker",d,!0)}else m=h.post(f,"marker");this.createLabel(b,n.rseg[c],{x:a.x-J/2,y:a.y-K/2,width:J,height:K},m)},this)}}a.dirty=!1}}else a.dirty=!1,h.skip();else h.skip(),this._reconnectEvents(a.name)}L("dojo-bidi")&&this._checkOrientation(this.group,g,c);this.animate&&(l=this.getGroup(),Q.animateTransform(w.delegate({shape:l,duration:1200,transform:[{name:"translate",
start:[0,g.height-c.b],end:[0,0]},{name:"scale",start:[1,0],end:[1,1]},{name:"original"}]},this.animate)).play());this.dirty=!1;return this}})});