//>>built
define("dojox/charting/DataChart","dojo/_base/kernel dojo/_base/lang dojo/_base/declare dojo/_base/html dojo/_base/connect dojo/_base/array ./Chart2D ./themes/PlotKit/blue dojo/dom".split(" "),function(q,d,r,m,k,g,t,u,v){q.experimental("dojox.charting.DataChart");var w={vertical:!0,min:0,max:10,majorTickStep:5,minorTickStep:1,natural:!1,stroke:"black",majorTick:{stroke:"black",length:8},minorTick:{stroke:"gray",length:2},majorLabels:!0},x={natural:!0,majorLabels:!0,includeZero:!1,majorTickStep:1,
majorTick:{stroke:"black",length:8},fixUpper:"major",stroke:"black",htmlLabels:!0,from:1},n={markers:!0,tension:2,gap:2};return r("dojox.charting.DataChart",t,{scroll:!0,comparative:!1,query:"*",queryOptions:"",fieldName:"value",chartTheme:u,displayRange:0,stretchToFit:!0,minWidth:200,minHeight:100,showing:!0,label:"name",constructor:function(b,a){this.domNode=v.byId(b);d.mixin(this,a);this.xaxis=d.mixin(d.mixin({},x),a.xaxis);"seriesLabels"==this.xaxis.labelFunc&&(this.xaxis.labelFunc=d.hitch(this,
"seriesLabels"));this.yaxis=d.mixin(d.mixin({},w),a.yaxis);"seriesLabels"==this.yaxis.labelFunc&&(this.yaxis.labelFunc=d.hitch(this,"seriesLabels"));this._events=[];this.convertLabels(this.yaxis);this.convertLabels(this.xaxis);this.onSetItems={};this.dataLength=this.onSetInterval=0;this.seriesData={};this.seriesDataBk={};this.firstRun=!0;this.dataOffset=0;this.chartTheme.plotarea.stroke={color:"gray",width:3};this.setTheme(this.chartTheme);this.displayRange&&(this.stretchToFit=!1);this.stretchToFit||
(this.xaxis.to=this.displayRange);var c=a.type&&"Pie"!=a.type&&"dojox.charting.plot2d.Pie"!=a.type.prototype.declaredClass;c&&(this.addAxis("x",this.xaxis),this.addAxis("y",this.yaxis));n.type=a.type||"Markers";this.addPlot("default",d.mixin(n,a.chartPlot));c&&this.addPlot("grid",d.mixin(a.grid||{},{type:"Grid",hMinorLines:!0}));this.showing&&this.render();a.store&&this.setStore(a.store,a.query,a.fieldName,a.queryOptions)},destroy:function(){g.forEach(this._events,k.disconnect);this.inherited(arguments)},
setStore:function(b,a,c,e){this.firstRun=!0;this.store=b||this.store;this.query=a||this.query;this.fieldName=c||this.fieldName;this.label=this.store.getLabelAttributes();this.queryOptions=e||e;g.forEach(this._events,k.disconnect);this._events=[k.connect(this.store,"onSet",this,"onSet"),k.connect(this.store,"onError",this,"onError")];this.fetch()},show:function(){this.showing||(m.style(this.domNode,"display",""),this.showing=!0,this.render())},hide:function(){this.showing&&(m.style(this.domNode,"display",
"none"),this.showing=!1)},onSet:function(b){var a=this.getProperty(b,this.label);if(a in this.runs||this.comparative)clearTimeout(this.onSetInterval),this.onSetItems[a]||(this.onSetItems[a]=b),this.onSetInterval=setTimeout(d.hitch(this,function(){clearTimeout(this.onSetInterval);var c=[],e;for(e in this.onSetItems)c.push(this.onSetItems[e]);this.onData(c);this.onSetItems={}}),200)},onError:function(b){},onDataReceived:function(b){},getProperty:function(b,a){if(a==this.label)return this.store.getLabel(b);
if("id"==a)return this.store.getIdentity(b);var c=this.store.getValues(b,a);2>c.length&&(c=this.store.getValue(b,a));return c},onData:function(b){if(b&&b.length){this.items&&this.items.length!=b.length&&(g.forEach(b,function(e){var l=this.getProperty(e,"id");g.forEach(this.items,function(f,h){this.getProperty(f,"id")==l&&(this.items[h]=f)},this)},this),b=this.items);this.stretchToFit&&(this.displayRange=b.length);this.onDataReceived(b);this.items=b;if(this.comparative){var a="default";this.seriesData[a]=
[];this.seriesDataBk[a]=[];g.forEach(b,function(e){e=this.getProperty(e,this.fieldName);this.seriesData[a].push(e)},this)}else g.forEach(b,function(e,l){var f=this.store.getLabel(e);this.seriesData[f]||(this.seriesData[f]=[],this.seriesDataBk[f]=[]);var h=this.getProperty(e,this.fieldName);if(d.isArray(h))this.seriesData[f]=h;else{if(this.scroll)this.seriesDataBk[f].length>this.seriesData[f].length&&(this.seriesData[f]=this.seriesDataBk[f]),this.seriesData[f].push(Number(h));else{var p=g.map(Array(l+
1),function(){return 0});p.push(Number(h));this.seriesData[f]=p}this.seriesDataBk[f].push(Number(h))}},this);if(this.firstRun)for(a in this.firstRun=!1,this.seriesData){this.addSeries(a,this.seriesData[a]);var c=this.seriesData[a]}else for(a in this.seriesData)c=this.seriesData[a],this.scroll&&c.length>this.displayRange&&(this.dataOffset=c.length-this.displayRange-1,c=c.slice(c.length-this.displayRange,c.length)),this.updateSeries(a,c);this.dataLength=c.length;this.showing&&this.render()}},fetch:function(){this.store&&
this.store.fetch({query:this.query,queryOptions:this.queryOptions,start:this.start,count:this.count,sort:this.sort,onComplete:d.hitch(this,function(b){setTimeout(d.hitch(this,function(){this.onData(b)}),0)}),onError:d.hitch(this,"onError")})},convertLabels:function(b){if(!b.labels||d.isObject(b.labels[0]))return null;b.labels=g.map(b.labels,function(a,c){return{value:c,text:a}});return null},seriesLabels:function(b){b--;if(1>this.series.length||!this.comparative&&b>this.series.length)return"-";if(this.comparative)return this.store.getLabel(this.items[b]);
for(var a=0;a<this.series.length;a++)if(0<this.series[a].data[b])return this.series[a].name;return"-"},resizeChart:function(b){this.resize(Math.max(b.w,this.minWidth),Math.max(b.h,this.minHeight))}})});