ExtJS Pie Chart: Define slices colors

Background

While using Pie Chart of ExtJS, you may want to define every slice yourself.

ExtJS Version

ExtJS 5.1.0

Code

 1 xtype: 'polar',
 2 … ...
 3 series: [{
 4     type: 'pie',
 5     renderer: function(sprite, record, attr, index, store) {
 6         return Ext.apply(attr, {
 7         fill: [ "#ead22c","#ff0101","#1fba07"][index%3]
 8     });
 9     },
10     … …
11 }]

Reference

原文地址:https://www.cnblogs.com/yuxiaoqi/p/4788845.html