PDA

View Full Version : chart from grid



mille07
24 Oct 2012, 6:28 AM
can someone please say how to make a chart using data from this example grid
http://www.mysamplecode.com/2012/06/extjs-local-storage-example.html
thanks

raphaelhbohrer
24 Oct 2012, 12:09 PM
Get store in a var myStore;
Make a button with a handler;
Make a panel with a chart;



Ext.create('Ext.Button', {
text : 'open chart',
handler: function() {

Ext.widget('mychart',{
myStore: myStore
});
}
})




Ext.define('Path.to.Chart', {
extend: 'Ext.panel.Panel',
alias: 'widget.mychart',
titleAlign: 'center',
title: ('Chart'),
width: '100%',
height: 450,

initComponent: function() {
var me = this;
if(!me.myStore){
me.myStore= Ext.create('paht.store.newStore.Horas');
}
Ext.applyIf(me, {
items: [
{
xtype: 'chart',
width: '600',
height: '400',
store: me.myStore,

......
}
]
});
me.callParent(arguments);
}