【问题标题】:EXTJS generation of bar chartEXTJS生成条形图
【发布时间】:2012-05-18 14:50:38
【问题描述】:

我正在研究 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 到最大值

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

请帮忙........ 谢谢

【问题讨论】:

    标签: javascript extjs extjs4 extjs-mvc


    【解决方案1】:

    要在网格单击事件上生成图表,我们使用侦听器 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
    

    谢谢...

    【讨论】:

      猜你喜欢
      • 2011-08-14
      • 2012-02-06
      • 1970-01-01
      • 1970-01-01
      • 2020-03-27
      • 1970-01-01
      • 2021-12-18
      • 2021-01-12
      • 1970-01-01
      相关资源
      最近更新 更多