Ext.define("Ext.ux.google.charts.Charts", {
	extend: "Ext.container.Container",

	mixins: [
		"Ext.mixin.Mashup"
	],

	requiredScripts: [
		"/portfolio/app/ux/google/google-chart.js"
	],

	config: {
		chartApi: null,
		visualizationApi: null,
		chartOptions: null
	},

	listeners: {
		destroy: {
			fn: function(i_container) {
				i_container.setChartOptions(null);
			}
		}
	},

	initComponent: function() {
		this.callParent(arguments);
		if (this.getChartOptions() == null) {
			this.setChartOptions({});
		}
		this.setChartApi(google.charts);
	},

	getInnerDom: function() {
		return Ext.query("[data-ref=innerCt]", true, this.getEl())[0];
	}
});
