extjs 中 我的panel中设置collapsed:true,当我通过后台将数据通过panel.add方法填充进去的时候不显示 20
varshowChart=function(storeData){$('#chartDiv').empty();panel=Ext.create('Ext.panel.P...
var showChart=function(storeData){
$('#chartDiv').empty();
panel=Ext.create('Ext.panel.Panel', {
title: 'xxx',
width: Ext.get('chartDiv').getWidth(),
height:600,
collapsible:true,
collapsed:true,
renderTo: Ext.get('chartDiv'),
layout: 'fit',
items: {
xtype: 'chart',
id: 'chartCmp',
animate: true,
store:storeData,
shadow: true,
legend: {
position: 'right'
},
insetPadding: 60,
theme: 'Base:gradients',
series: [{
type: 'pie',
field: 'data',
showInLegend: true,
tips: {
trackMouse: true,
width: 140,
height: 28,
renderer: function(storeItem, item) {
//calculate percentage.
var total = 0;
store:storeData.each(function(rec) {
total += rec.get('data');
});
this.setTitle(storeItem.get('name') + ': ' + Math.round(storeItem.get('data') / total * 100) + '%');
}
},
highlight: {
segment: {
margin: 20
}
},
label: {
field: 'name',
display: 'rotate',
contrast: true,
font: '18px Arial'
}
}]
}
});
换成这样也不行 展开
$('#chartDiv').empty();
panel=Ext.create('Ext.panel.Panel', {
title: 'xxx',
width: Ext.get('chartDiv').getWidth(),
height:600,
collapsible:true,
collapsed:true,
renderTo: Ext.get('chartDiv'),
layout: 'fit',
items: {
xtype: 'chart',
id: 'chartCmp',
animate: true,
store:storeData,
shadow: true,
legend: {
position: 'right'
},
insetPadding: 60,
theme: 'Base:gradients',
series: [{
type: 'pie',
field: 'data',
showInLegend: true,
tips: {
trackMouse: true,
width: 140,
height: 28,
renderer: function(storeItem, item) {
//calculate percentage.
var total = 0;
store:storeData.each(function(rec) {
total += rec.get('data');
});
this.setTitle(storeItem.get('name') + ': ' + Math.round(storeItem.get('data') / total * 100) + '%');
}
},
highlight: {
segment: {
margin: 20
}
},
label: {
field: 'name',
display: 'rotate',
contrast: true,
font: '18px Arial'
}
}]
}
});
换成这样也不行 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询