1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    2
    Vote Rating
    0
    mille07 is on a distinguished road

      0  

    Default Unanswered: chart from grid

    Unanswered: chart from grid


    can someone please say how to make a chart using data from this example grid
    http://www.mysamplecode.com/2012/06/...e-example.html
    thanks

  2. #2
    Sencha User
    Join Date
    Dec 2011
    Posts
    15
    Vote Rating
    0
    raphaelhbohrer is on a distinguished road

      0  

    Default


    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);
        }

Thread Participants: 1

Tags for this Thread