0

我正在研究 extjs & 我想从 xml 制作条形图 这是我的 XML

http://pastebin.ca/2150257

我做了这样的网格

columns: [
{text: "Department Performance", flex: 1,dataIndex: 'DepartmentPerformance', sortable: true},
{text : 'Domestic',
columns: [
{text: "YTD", width: 50, dataIndex: 'DomesticYTD', sortable: true},
{text: "MTD", width: 50, dataIndex: 'DomesticMTD', sortable: true},
{text: "Daily", width: 50, dataIndex: 'DomesticDaily', sortable: true}
]},
{text : 'Other',
columns: [
{text: "YTD", width: 50, dataIndex: 'OtherYTD', sortable: true},
{text: "MTD", width: 50, dataIndex: 'OtherMTD', sortable: true},
{text: "Daily", width: 50, dataIndex: 'OtherDaily', sortable: true},
]},
{text : 'Total',
columns: [
{text: "YTD", width: 50, dataIndex: 'TotalYTD', sortable: true},
{text: "MTD", width: 50, dataIndex: 'TotalMTD', sortable: true},
{text: "Daily", width: 50, dataIndex: 'TotalDaily', sortable: true},
]},

{text : 'OEM',
columns: [
{text: "YTD", width: 50, dataIndex: 'OEMYTD', sortable: true},
{text: "MTD", width: 50, dataIndex: 'OEMMTD', sortable: true},
]},

],

&我想按行制作图表,因为单击行我不知道如何使用侦听器并制作柱形图

就像 X 轴 3 部分国内 & 其他 & 总计 , 在每个部分 YTD,MTD,DAILY & Y 轴仅值 0 到最大值

我尝试了很多但无法按行值创建图表

请帮助..................谢谢

4

1 回答 1

0

要在网格单击事件上生成图表,我们使用侦听器 selectionchange 事件在选择更改时生成分配给条形图的新商店

selectionchange: function (view, selections, options) {
                          //console.log(view, selections, options);
                          record = selections[0];
                          //var v = record.get('Field1');
                          //alert(''+v);
                          //alert(''+index)
                         // alert('hiiii')


                        record = selections[0];

                        myData=[['Domestic',record.get('field1'),record.get('field2'),record.get('field3')],
                                     ['Export',record.get('field4'),record.get('field5'),record.get('field6')],
                                     ['Other',record.get('field7'),record.get('field8'),record.get('field8'),
                                     ]]

                        }

这是示例演示链接......

http://dev.sencha.com/deploy/ext-4.1.0-gpl/examples/charts/FormDashboard.html

谢谢...

于 2012-08-10T06:12:19.977 回答