我在3.2.1中创建一个饼图。然后我将此图表添加到字段集中。但它没有将图表显示在字段集中。仅显示空白页面。并在控制台“未捕获TypeError:错误#1007”中显示此错误。 这是我的代码 -
createChart: function(node, fieldSetId, KWTags) {
var store = new Ext.data.JsonStore({
fields: ['name', 'data'],
data: [{
"name": "Item-0",
"data": 5
}, {
"name": "Item-1",
"data": 7
}, {
"name": "Item-2",
"data": 3
}, {
"name": "Item-3",
"data": 6
}, {
"name": "Item-4",
"data": 2
}, {
"name": "Item-5",
"data": 8
}]
});
var chart = new Ext.chart.Chart({
width: 200,
height: 350,
animate: true,
store: store,
theme: 'Base:gradients',
series: [{
type: 'pie',
angleField: 'data',
showInLegend: true,
tips: {
trackMouse: true,
width: 140,
height: 28,
renderer: function(storeItem, item) {
this.setTitle(storeItem.get('name') + ' ate ' + storeItem.get('data') + ' cookies');
}
},
label: {
field: 'name',
display: 'rotate',
//contrast: true,
font: '18px Arial'
}
}]
});
return chart;
},