2012-05-18 65 views
0

我對ExtJS的&工作我想通過XML 下面的柱狀圖是我的XMLEXTJS代條形圖

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 &ý - 軸只值0到最大值

我嘗試了很多,但不能夠通過行值創建圖表

請幫助................. 感謝

回答

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 

謝謝...

+0

感謝............. :) – Amit