Ext.onReady(function()
{
Ext.create('Ext.window.Window',
{
title: 'Pie1 Chart',
height: 400,
layout: 'fit',
width: 400,
items:
[{
xtype: 'chart',
animate:false ,
insetPadding:0,
legend:
{
position: 'right'
},
shadow: true,
store:
{
fields:
[{
name: 'category', type: 'string'
},
{
name: 'data', type: 'float'
}],
data:
[{
category: 'Alive', data: 1.5
},{
category: 'Dead', data: 2
},{
category: 'Standby', data: 1
}]
},
series: [{
type: 'pie',
field: 'data',
colorSet: ['#0000FF','#FFffff','#00FF00'],
showInLegend: true, <!--It is use to display data in which color.-->
highlight: {
segment: {
margin: 20
}
},
label: {
field: 'category',
display: 'rotate',
contrast: true,
font: '18px Arial'
}
}]
}]
}).show();
});
使用colorSet可以改變顏色。
非常感謝!它工作正常 – Nazin 2011-06-16 10:58:35