Chart works from within the controller, but not from the view
Hello,
I am trying to get a chart to render, but i am having issues. I keep getting "Uncaught TypeError: Cannot read property 'theme' of undefined ext-all-debug.js:41482"
My store works fine as this error only happens when initializing the view.
app.js:
Code:
Ext.Loader.setConfig({enabled:true});
var siteAppPath = 'http://localhost/analytics/public/js/analytics/app';
Ext.application({
name: 'Analytics',
appFolder: siteAppPath,
controllers: ['Reporter'],
launch: function() {
console.log('app');
}
});
controller/Reporter.js:
Code:
Ext.define('Analytics.controller.Reporter', { extend: 'Ext.app.Controller',
views: ['charts.AssemInOut'] ,
stores: ['dsAssemInOut'],
models: ['AssemInOut'],
init: function() {
console.log('contro');
var ch = Ext.create('ch.asio');
ch.show();
}
});
view/charts/AssemInOut:
Code:
Ext.define('Analytics.view.charts.AssemInOut', { extend: 'Ext.chart.Chart',
alias: 'ch.asio',
initComponent: function() {
Ext.apply(this, {
width: 400,
height: 500,
store: 'dsAssemInOut',
renderTo: Ext.getBody(),
axes: [
{
title: 'Total Ins and Outs',
type: 'Numeric',
position: 'bottom',
fields: ['qtyIn', 'qtyOut'],
label: {
renderer: Ext.util.Format.numberRenderer('0,0')
},
minimum: 0
},
{
title: 'Work Centers',
type: 'Category',
position: 'left',
fields: ['sequence_name']
}
],
series: [
{
type: 'bar',
axis: 'bottom',
xField: 'sequence_name',
yField: ['qtyIn', 'qtyOut']
}
]
});
this.callParent(arguments);
}
});
The store and model are working just fine so i ll omit them from now as it seems that the problem is with the view.
I found some other posts about a bug in ext-4.0.2a, but they are from July and June so i am not sure if this still applies as i downloaded it about 3 weeks ago.
Any help is appreciated.
Thanks