2

ExtJS3 を使用しており、このチャートを動的ストアのあるパネルに配置したい http://dev.sencha.com/deploy/ext-3.4.0/examples/chart/pie-chart.html

このチャートをパネル コードに含めようとしましたが、うまくいきませんでした。ExtJS3のパネルに含まれるチャートの解決策または例を誰かが持っていますか

ありがとうございました

4

1 に答える 1

0

あなたの例を使用して、動的ストアを使用してチャートを生成しました。

Ext.chart.Chart.CHART_URL = 'http://dev.sencha.com/deploy/ext-3.4.0/resources/charts.swf';

Ext.onReady(function(){
    var store = new Ext.data.JsonStore({
    url: "sample_data.php",
    root: 'results',
    fields: [
         {name: 'season'},
         {name: 'total'}
    ]
});

    new Ext.Panel({
        width: 400,
        height: 400,
        title: 'Pie Chart with Legend - Favorite Season',
        renderTo: 'container',
        items: {
            store: store,
            xtype: 'piechart',
            dataField: 'total',
            categoryField: 'season',
            //extra styles get applied to the chart defaults
            extraStyle:
            {
                legend:
                {
                    display: 'bottom',
                    padding: 5,
                    font:
                    {
                        family: 'Tahoma',
                        size: 13
                    }
                }
            }
        }
    });
});

wherehttp://dev.sencha.com/deploy/ext-3.4.0/resources/charts.swfはチャートを見つけることができるターゲットであり、sample_data.php は次の json を返します。

{"results":[
    {"total":"150","season":"Summer"},
    {"total":"245","season":"Fall"},
    {"total":"117","season":"Winter"},
    {"total":"184","season":"spring"}
]}

: 通常、これはローカル リソースに設定する必要があります。

お役に立てれば。

于 2013-02-06T14:35:52.120 に答える