图表extjs4中串联块中的渲染器

图表extjs4中串联块中的渲染器,extjs4,extjs4.2,Extjs4,Extjs4.2,我想更改extjs type='pie'中图表的颜色。 我可以在序列块中使用渲染器吗?请参见示例: ..... }, series : [ { type : 'bar', axis : 'bottom', gutter : 0, groupGutter : 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
                        });
                    },.....

您可以为系列使用colorSet属性,而不是自定义渲染器

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

请参见

这仅适用于饼图