Get store in a var myStore;
Make a button with a handler;
Make a panel with a chart;
Code:
Ext.create('Ext.Button', {
text : 'open chart',
handler: function() {
Ext.widget('mychart',{
myStore: myStore
});
}
})
Code:
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);
}