0

extjs type ='pie' のグラフの色を変えたいです。シリーズ ブロックでレンダラーを使用できますか? 例を参照してください:

.....    },
                series : [ {
                    type : 'bar',
                    axis : 'bottom',
                    gutter : 0,
                    groupGutter : 0,
                    yField : this.fields,
                    title : this.fieldTitles,
                    stacked : true,
                    fill: true,
                    scope: this,
                    renderer: function(sprite, record, attr, index, store) {
                        var color = this.fieldColors[index];
                        return Ext.apply(attr, {
                            fill: color
                        });
                    },.....
4

1 に答える 1

0

カスタム レンダラーの代わりに、シリーズの colorSet プロパティを使用できます。

series: [{
    colorSet: this.fieldColors,
    ...
}]

http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.chart.series.Pie-cfg-colorSetを参照してください。

于 2013-08-10T00:27:26.217 に答える