myStore = Ext4.create('store.array', { idIndex: 0, fields: [ 'id', 'company', 'money', ], data: [ [ 1, ' " "', 100000 ], [ 2, ' ', 12000 ], [ 3, ' " "', 45000 ] ] });
// Ext4.onReady(...), Ext.onReady(...) Ext4.onReady(function(){ // , // Grid (Ext JS 3) Chart (Ext JS 4) var companiesStoreConfig = { idIndex: 0, fields: [ 'id', 'company', 'money' ], data: [ [ 1, ' " "', 51000 ], [ 2, ' ', 12000 ], [ 3, ' " "', 43000 ], [ 4, ' " "', 31000 ], [ 5, ' " "', 9000 ] ] }; // - Ext4, // // , . // - Ext. var companiesStore = new Ext4.data.ArrayStore(companiesStoreConfig); // (Ext JS 3) var grid = new Ext.grid.GridPanel({ store: companiesStore, // columns: [ // { id :'company', header : '', sortable : true, dataIndex: 'company' }, { header : '', width : 70, sortable : true, dataIndex: 'money' } ], renderTo: 'gridDiv', autoExpandColumn: 'company', width: 350, autoHeight: true, border: false, frame: false, title: '' }); // (Ext JS 4) var chart = Ext4.createWidget('panel', { width: 795, height: 440, renderTo: 'chartDiv', border: false, frame: false, layout: 'fit', items: [{ xtype: 'chart', store: companiesStore, legend: { field: 'company', position: 'right' }, theme: 'Base:gradients', series: [{ type: 'pie', donut: 35, field: 'money', showInLegend: true, label: { field: 'company', display: 'rotate', contrast: true, font: '12px Arial', renderer: function(v){ return ''; } } }] }] }); });
{ ... renderTo: Ext.getBody() ... }
{ ... renderTo: Ext4.getBody() ... }
Source: https://habr.com/ru/post/128557/
All Articles