使用网格存储绘制条形图

时间:2019-08-22 11:17:04

标签: extjs

有一个网格,其中很少有列,例如姓名,年龄,工资,职务 该网格具有自己的存储库,通过该存储库可以将数据填充到网格中 必须使用同一家商店使用Ext js绘制条形图,该条形图在x轴显示Desgnation,在y轴显示薪水。

在我的主页上,我已使用

{
    xtype : 'person_list',
    itemId : 'person_list'
}, {
    xtype : 'person_statistics',
    itemId : 'person_statistics'
}

Ext.define('person_list',{
    xtype : 'person_list',
    store: {
           data: [{
               name: 'A',
               age: 20,
               salary: '10000',
               designation: 'Engineer'
           }, {
               name: 'B',
               age: 21,
               salary: '20000',
               designation: 'Associate'
           }, {
               name: 'C',
               age: 22,
               salary: '11000',
               designation: 'Senior Engg'
           }, {
               name: 'D',
               age: 23,
               salary: '12000',
               designation: Lead'
           }]

    }
    columns: [{
        items : [ {
            text : 'name',
            dataIndex : 'name'
        },{
            text : 'Age',
            dataIndex : 'Age'
        },{
            text : 'Salary',
            dataIndex : 'Salary'
        },{
            text : 'Designation',
            dataIndex : 'Designation'
        }]
    }]
})


Ext.define('person_statistics',{
    xtype : 'person_statistics',

    axes: [{
       type: 'numeric',
       position: 'left',
       title: {
           text: 'Salary',
           fontSize: 15
       },
       fields: 'value'
   }, {
       type: 'category',
       position: 'bottom',
       title: {
           text: 'Designation',
           fontSize: 15
       },
       fields: 'name'
   }],
})

这两个是不同的文件。如何使用统计文件中的网格存储?

0 个答案:

没有答案