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