//>>built
define("dojox/charting/widget/Chart","dojo/_base/kernel dojo/_base/lang dojo/_base/array dojo/dom-attr dojo/_base/declare dojo/query dijit/_WidgetBase ../Chart dojo/has dojo/has!dojo-bidi?../bidi/widget/Chart dojox/lang/utils dojox/lang/functional dojox/lang/functional/lambda".split(" "),function(k,m,v,A,y,n,p,B,z,C,q,D,E){var r=function(c){return c},t=m.getObject("dojox.charting");var w=function(c,d,b){var a=eval("("+d+".prototype.defaultParams)"),e;for(e in a)if(!(e in b)){var f=c.getAttribute(e);
b[e]=q.coerceType(a[e],null==f||"undefined"==typeof f?a[e]:f)}d=eval("("+d+".prototype.optionalParams)");for(e in d)e in b||(f=c.getAttribute(e),null!=f&&(b[e]=q.coerceType(d[e],f)))};var F=function(c){var d=c.getAttribute("name"),b=c.getAttribute("type");if(!d)return null;d={name:d,kwArgs:{}};var a=d.kwArgs;if(b){t.axis2d[b]&&(b=k._scopeName+"x.charting.axis2d."+b);var e=eval("("+b+")");e&&(a.type=e)}else b=k._scopeName+"x.charting.axis2d.Default";w(c,b,a);if(a.font||a.fontColor)a.tick||(a.tick=
{}),a.font&&(a.tick.font=a.font),a.fontColor&&(a.tick.fontColor=a.fontColor);return d};var G=function(c){var d=c.getAttribute("name"),b=c.getAttribute("type");if(!d)return null;d={name:d,kwArgs:{}};var a=d.kwArgs;if(b){t.plot2d&&t.plot2d[b]&&(b=k._scopeName+"x.charting.plot2d."+b);var e=eval("("+b+")");e&&(a.type=e)}else b=k._scopeName+"x.charting.plot2d.Default";w(c,b,a);b=eval("("+b+".prototype.baseParams)");for(var f in b)f in a||(e=c.getAttribute(f),a[f]=q.coerceType(b[f],null==e||"undefined"==
typeof e?b[f]:e));return d};var H=function(c){var d=c.getAttribute("plot"),b=c.getAttribute("type");d||(d="default");d={plot:d,kwArgs:{}};var a=d.kwArgs;if(b){t.action2d[b]&&(b=k._scopeName+"x.charting.action2d."+b);var e=eval("("+b+")");if(!e)return null;d.action=e}else return null;w(c,b,a);return d};var I=function(c){c=m.partial(A.get,c);var d=c("name");if(!d)return null;d={name:d,kwArgs:{}};var b=d.kwArgs;var a=c("plot");null!=a&&(b.plot=a);a=c("marker");null!=a&&(b.marker=a);a=c("stroke");null!=
a&&(b.stroke=eval("("+a+")"));a=c("outline");null!=a&&(b.outline=eval("("+a+")"));a=c("shadow");null!=a&&(b.shadow=eval("("+a+")"));a=c("fill");null!=a&&(b.fill=eval("("+a+")"));a=c("font");null!=a&&(b.font=a);a=c("fontColor");null!=a&&(b.fontColor=eval("("+a+")"));a=c("legend");null!=a&&(b.legend=a);a=c("data");if(null!=a)return d.type="data",d.data=a?v.map(String(a).split(","),Number):[],d;a=c("array");if(null!=a)return d.type="data",d.data=eval("("+a+")"),d;a=c("store");if(null!=a){d.type="store";
d.data=eval("("+a+")");a=c("field");d.field=null!=a?a:"value";if(a=c("query"))b.query=a;if(a=c("queryOptions"))b.queryOptions=eval("("+a+")");if(a=c("start"))b.start=Number(a);if(a=c("count"))b.count=Number(a);if(a=c("sort"))b.sort=eval("("+a+")");if(a=c("valueFn"))b.valueFn=E.lambda(a);return d}return null};p=y(z("dojo-bidi")?"dojox.charting.widget.NonBidiChart":"dojox.charting.widget.Chart",p,{theme:null,margins:null,stroke:void 0,fill:void 0,buildRendering:function(){this.inherited(arguments);
var c=this.domNode,d=n("\x3e .axis",c).map(F).filter(r),b=n("\x3e .plot",c).map(G).filter(r),a=n("\x3e .action",c).map(H).filter(r),e=n("\x3e .series",c).map(I).filter(r);c.innerHTML="";var f=this.chart=new B(c,{margins:this.margins,stroke:this.stroke,fill:this.fill,textDir:this.textDir});this.theme&&f.setTheme(this.theme);d.forEach(function(h){f.addAxis(h.name,h.kwArgs)});b.forEach(function(h){f.addPlot(h.name,h.kwArgs)});this.actions=a.map(function(h){return new h.action(f,h.plot,h.kwArgs)});D.foldl(e,
function(h,g){if("data"==g.type)f.addSeries(g.name,g.data,g.kwArgs),h=!0;else{f.addSeries(g.name,[0],g.kwArgs);var u={};q.updateWithPattern(u,g.kwArgs,{query:"",queryOptions:null,start:0,count:1},!0);g.kwArgs.sort&&(u.sort=m.clone(g.kwArgs.sort));m.mixin(u,{onComplete:function(l){if("valueFn"in g.kwArgs){var J=g.kwArgs.valueFn;l=v.map(l,function(x){return J(g.data.getValue(x,g.field,0))})}else l=v.map(l,function(x){return g.data.getValue(x,g.field,0)});f.addSeries(g.name,l,g.kwArgs).render()}});g.data.fetch(u)}return h},
!1)&&f.render()},destroy:function(){this.chart.destroy();this.inherited(arguments)},resize:function(c){this.chart.resize.apply(this.chart,arguments)}});return z("dojo-bidi")?y("dojox.charting.widget.Chart",[p,C]):p});