Hello!
I'm having some trouble with Charts only in build, in dev works fine with no errors.
This is the error that console returns:
Code:
Uncaught TypeError: Cannot read property 'length' of undefined
This is the Chart view:
Code:
Ext.define("MyApp.view.Chart", {
extend: 'Ext.chart.Chart',
xtype: 'mychart',
layout: 'fit',
style: 'background:#fff',
animate: true,
shadow: true,
requires : [
'MyApp.store.ChartStore'
],
store: {
type: 'mystore'
},
axes: [{
type: 'Numeric',
position: 'left',
fields: ['number'],
// label: {
// // renderer: Ext.util.Format.numberRenderer('0.0')
// },
title: 'Vel',
grid: true,
minimum: 0
}, {
type: 'Category',
position: 'bottom',
fields: ['data']
// title: 'Data'
}],
series: [
{
type: 'column',
axis: 'left',
highlight: true,
tips: {
trackMouse: true,
width: 160,
height: 28,
renderer: function(storeItem, item) {
this.setTitle(storeItem.get('data') + ': ' + storeItem.get('number'));
}
},
renderer: function(sprite, storeItem, barAttr, i, store) {
barAttr.fill = '#225885';
return barAttr;
},
label: {
display: 'insideEnd',
'text-anchor': 'middle',
font: '1em bold arial, verdana',
field: 'number',
renderer: function(v){
return Ext.String.format(v.toFixed(2).toString().replace('.',','));
},
orientation: 'vertical',
color: '#fff'
},
xField: 'data',
yField: 'number'
}
]
});
And this is the Store:
Code:
Ext.define('MyApp.store.ChartStore', {
extend: 'Ext.data.Store',
model: 'MyApp.model.ChartStore',
alias : 'store.mystore',
autoLoad: false,
groupField: 'name',
// pageSize: 25,
proxy: {
type: 'ajax',
api: {
read: 'resources/data/ajx_list_chart.php'
},
reader: {
type: 'json',
root: 'data',
// totalProperty: 'total',
successProperty: 'success'
},
writer: {
type: 'json',
root: 'data',
encode: true
}
}
});
Thanks! 