0
這是關於ExtJs5 charts.I無法更改條形圖的標籤。如何更改Extjs5中條形圖的標籤?
代碼是如下:
Ext.create('Ext.chart.CartesianChart', {
store: {
fields: ['pet', 'households', 'total'],
data: [{
pet: {name:'Cats'},
households: 38,
total: 93
}]
},
axes: [{
type: 'numeric',
position: 'left'
}, {
type: 'category',
position: 'bottom'
}],
series: [{
type: 'bar',
xField: 'pet',
yField: 'households',
label:{
field:'pet',
renderer:function(pet){
return 'Dear '+pet.name;
}
}
}]
});
您一定已經注意到了該領域的「寵物」是一個對象而不是字符串。 渲染器在系列標籤返回我想要它的值,但標籤仍然是[object Object]!該類別下