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]!该类别下