0

画面に 2 つのオブジェクトがあり、グリッドとチャートが同じストアによって取り込まれています。私がする必要があるのは、グリッドでクリックしたアイテムに関連するグラフの列を強調表示することです。

関数では、Ext.getCmp('chart').series.get(0) を使用して半分の方法を考え出しました。しかし、getItemForPoint(x,y) が null 値を返し続けるため、シリーズの各アイテムを取得して強調表示するために何をすべきかわかりません...

どうもありがとう、以下のコード:

// Code for my grid
{
 columnWidth: .25
 ,xtype: 'grid'
 ,hideHeaders: true
 ,border: true
 ,styke: 'padding-top: 60px;'
 ,height: 360
 ,store: participation
 ,columns: [{
      dataIndex: 'ID'
      ,width: 24
 },{
      dataIndex: 'Supplier'
      ,width: 204
}]
 ,listeners: {
      select: function() {
           // function to highlight the column on my chart
      }
 }
}

// Code for my chart
{
 border: false
 ,layout: 'column'
 ,items: [{
    columnWidth: .75
    ,xtype: 'chart'
    ,animate: true
    ,height: 432
    ,shadow: false
    ,id: 'chart'
    ,store: participation
    ,axes: [{
        type: 'Numeric'
        ,position: 'left'
        ,grid: true
        ,fields: 'Participation'
        ,title: 'Share'
        ,label: {
            renderer: Ext.util.Format.numberRenderer('0.00'+"%")
        }
    },{
        type: 'Category'
        ,position: 'bottom'
        ,fields: 'ID'
    }]
    ,series: [{
        type: 'column'
        ,axis: 'left'
        ,highlight: 'true'
        ,xField: 'ID'
        ,yField: 'Participation'
        ,tips: {
            trackMouse: true
            ,width: 312
            ,maxWidth: 360
            ,height: 36
            ,constrainPosition: true
            ,renderer: function(storeItem, item) {
                this.setTitle('Supplier: ' + storeItem.get('Supplier')+'<br/>'+'Share: ' + Ext.util.Format.number(storeItem.get('Share'),"0.00")+'%');
            }
        }
        ,style: {
            lineWidth: 1
            ,stroke: '#666'
        }
    }]
  }
 }
4

1 に答える 1

0

ExtJSの例でダイナミック フォーム、グリッド、チャートをご覧ください。この例は、達成しようとしていることを正確に示しています。chart や gridPanel に付属するリスナー(selectionchange イベントなど)を参照してください。

于 2012-05-24T05:57:05.760 に答える