(function(){u8.Base.Widgets.ChartEditor=function(t,e){this.Widget(t,$.extend({},u8.Base.Widgets.ChartEditor.defaults,e));this._form=null;this._initialChartType=null;this._isCreated=false;if(!this.options){this.options={}}this._create()};u8.Base.Widgets.ChartEditor.defaults={formName:"ChartEditor"};u8.Base.Widgets.ChartEditor.makeClass({name:"ChartEditor",deriveFrom:u8.Base.Widgets.Widget,events:["ValueChange","Create"]});$.extend(u8.Base.Widgets.ChartEditor.prototype,{setChartType:function(t){this.setValue({chartType:t})},setValue:function(t){if(this._form){this._form.context.setProperties(t)}},getValue:function(){return this._form&&this._form.context.getProperties()||{}},dispose:function(){if(this._isDisposed){return}this.Widget_dispose()},_create:function(){this.empty();var t=this;var e=this.$(this.element).append("<div />");this._form=new u8.Base.Widgets.Form(e,{parent:this,formName:this.formName,onCreate:function(e){var i=e.context;i.setProperties(t.options);i.bind("PropertyChange",t._onValueChange.bind(t));u8.tools.created(t)}})},_onValueChange:function(t,e){u8.log.debug("ChartEditor: option change '"+e.propertyName+"'");this.raise("ValueChange")}})})();