PDA

View Full Version : Chart.ux.Highcharts how to get work with simple store



eternasparta
15 Mar 2013, 7:51 AM
i'm trying to use Highcharts plugin and I've started with the simple example in his documentation
I've correctly set the enviroment (I'm sure).
This is the windows i've declared:

//other part of app.js (working)launch:function():{
var sto = Ext.create('AM.store.mysto');
var win = new Ext.create('Ext.window.Window', {
layout: 'fit',
items: [{
xtype: 'highchart',
series:[{
dashStyle: 'DashDot',
dataIndex: 'value'
}],
xField: 'month',
store: sto,
chartConfig: {
chart: {
type: 'spline'
},
title: {
text: 'A simple graph'
}
}
}]
}).show();
//other part of app.js (working)
}
//........more other part of app.js (working)


and I've declared the store as follow:


Ext.define('AM.store.mysto', { extend : 'Ext.data.Store',
model : 'AM.model.mysto',
data : [{
month : 'x',
value:1
}, {
month : 'y',
value:12,

value:2
}, {
month : 'z',
value:3
}]
});
And finally this is my model:


Ext.define('AM.model.mysto', { extend : 'Ext.data.Model',
fields : [{
name : 'month'
}, {
name : 'value'
}]
});


If I execute my application, this will be my window: an empty window with no chart inside.
42423
The only difference I've with the doc example is the store. Can someone tell me what is wrong? thank you!

mitchellsimoens
17 Mar 2013, 8:06 AM
You have layout : 'fit' on the window which will size the child item to the window's size so you would need to give the window a size.

eternasparta
21 Mar 2013, 2:29 AM
thank you! i've made a distraction error......