0

円グラフとその下に表示されるグリッドがあり、どちらも同じストアを使用しています。

そして、店内には、次のフィールドがあります。

合計、割り当て済み、使用済み、残り。

円グラフに合計フィールドを表示したくないので、4つのフィールドのうち3つだけを円グラフに含めることはできますか?ただし、グリッドにはそれを含める必要があります。それで、誰かがこれへの最良の方法は何であるか教えてもらえますか?

次のようにコーディングします。

円グラフ

var chart1 = Ext.create('Ext.chart.Chart', {
        id : 'chart1',
        xtype : 'chart',
        theme : '',
        animate : true,
        shadow : true,
        height : 250,
        width : 250,
        store : LicSumStore,
        series : [{
            type : 'pie',
            angleField : 'value',

            showInLegend : true,
            highlight :{
                segment :{
                    margin :20
                }
            } ,
            label : {
                field : 'title',
                display :'rotate',
                contrast : true,
                font : '12px Arial'
            },
            title : 'Licenses',

        }],

    });

グリッド

   var licSummaryGrid = Ext.create('Ext.grid.Panel',{
        title :'LicenseSummary',
        store : LicSumStore,
        enableColumnResize : false,
        columns : [
            {
                text : 'License Type', 
                dataIndex : 'title',
                width : 150,
                sortable : false,
                hideable : false,

            },
            {
                text : 'Count', 
                dataIndex : 'value', 
                width : 100,
                sortable : false,
                hideable : false,


            }
        ],

        height : 180,
        width : 255

    });
4

1 に答える 1

0

円グラフのデータを変更する代わりに、集計タイプを使用してグリッドに合計フィールドを追加することで、これを解決しました。したがって、ストアの合計フィールドを取り除き、グリッドで計算しました。

コードは次のとおりです。

{
    text: 'License Type',
    dataIndex: 'title',
    width: 150,
    sortable: false,
    hideable: false,
    summaryRenderer: function () {
        return Ext.String.format('Total');
    }
}, {
    text: 'Count',
    dataIndex: 'value',
    width: 100,
    sortable: false,
    hideable: false,
    summaryType: 'sum'

}
于 2012-09-27T10:51:40.167 に答える