Ext 向panel中添加Chart不显示,但是同一个Chart添加到window组建中就会显示。
//创建各地市缺失率折线图形varcreateZgAllCityChart=function(netType){varstartDate=newDate();ZgTren...
// 创建各地市缺失率折线图形
var createZgAllCityChart = function(netType) {
var startDate = new Date();
ZgTrendstore.load({
params : {
startDate : startDate,
endDate : startDate,
netType : netType
}
});
var zgAllCityChart = Ext.create('Ext.chart.Chart', {
animate : true,
height : '50%',
id:'zgAllCityChartid',
// region : "north",
store : ZgTrendstore,
collapsible : true,
axes : [{
type : 'Numeric',
position : 'left',
fields : ['data_nrate'],
label : {
renderer : Ext.util.Format
.numberRenderer('0,0')
},
title : '数据缺失率(%)',
grid : true,
minimum : 0,
maxinum : 20
}, {
type : 'Category',
position : 'bottom',
fields : ['city_name'],
title : '地市'
}],
series : [{
type : 'line',
highlight : {
size : 7,
radius : 7
},
axis : 'left',
xField : 'city_name',
yField : ['data_nrate'],
tips : {
trackMouse : true,
width : 84,
height : 38,
renderer : function(storeItem, item) {
this.setTitle(storeItem.get('timestamp') + '<br />'
+ storeItem.get('data_nrate') + "%");
}
},
markerCfg : {
type : 'cross',
size : 4,
radius : 4,
'stroke-width' : 0
}
}, {
type : 'column',
axis : 'left',
gutter : 80,
xField : 'city_name',
yField : ['data_nrate'],
tips : {
trackMouse : true,
width : 84,
height : 38,
renderer : function(storeItem, item) {
this.setTitle(storeItem.get('timestamp') + '<br />'
+ storeItem.get('data_nrate') + "%");
}
},
style : {
fill : '#38B8BF'
}
}]
})
return zgAllCityChart;
};
// 创建各地市缺失率折线图形end
Ext.define('Inspur.gsm_cmParam', {
extend : 'Ext.panel.Panel',
id : 'gsm_cmParam',
border : 0,
initComponent : function() { // 初始化gsm工参核查界面
this.callParent();
this.createChartpanel();
Ext.getCmp('chartpanel').add(Ext.getCmp('zgAllCityChartid'));//添加到panel中不显示
this.add(Ext.getCmp('chartpanel'));
//this.add(this.createChartpanel());
this.add(this.createGrid());
},
createChartpanel : function() { // 图形部分
var chartPanel = Ext.create('Ext.panel.Panel', {// myedit
height : '50%',
id : "chartpanel",
// layout:"border",
title : "各地市数据缺失率一览"
});
chartPanel.add(createZgAllCityChart("GSM"));
chartPanel.doLayout();
//return chartPanel;
},
});
openCmWin = function(time, cityName, casetype, fieldName) {
var win = Ext.create('Ext.window.Window', {
title : cityName + "-" + time + "-" + casetype,
height : 500,
width : 1070,
draggable : false,
layout : 'border'
});
if (casetype == 'GSM缺失原因分类明细') {
win.add(createZgCauseGrid(time, cityName, "GSM", fieldName));
win.add(createZgAllCityChart("GSM"));//添加到window组件中正常显示
}
win.show;
}
各地市缺失数据一览中,chart不显示 展开
var createZgAllCityChart = function(netType) {
var startDate = new Date();
ZgTrendstore.load({
params : {
startDate : startDate,
endDate : startDate,
netType : netType
}
});
var zgAllCityChart = Ext.create('Ext.chart.Chart', {
animate : true,
height : '50%',
id:'zgAllCityChartid',
// region : "north",
store : ZgTrendstore,
collapsible : true,
axes : [{
type : 'Numeric',
position : 'left',
fields : ['data_nrate'],
label : {
renderer : Ext.util.Format
.numberRenderer('0,0')
},
title : '数据缺失率(%)',
grid : true,
minimum : 0,
maxinum : 20
}, {
type : 'Category',
position : 'bottom',
fields : ['city_name'],
title : '地市'
}],
series : [{
type : 'line',
highlight : {
size : 7,
radius : 7
},
axis : 'left',
xField : 'city_name',
yField : ['data_nrate'],
tips : {
trackMouse : true,
width : 84,
height : 38,
renderer : function(storeItem, item) {
this.setTitle(storeItem.get('timestamp') + '<br />'
+ storeItem.get('data_nrate') + "%");
}
},
markerCfg : {
type : 'cross',
size : 4,
radius : 4,
'stroke-width' : 0
}
}, {
type : 'column',
axis : 'left',
gutter : 80,
xField : 'city_name',
yField : ['data_nrate'],
tips : {
trackMouse : true,
width : 84,
height : 38,
renderer : function(storeItem, item) {
this.setTitle(storeItem.get('timestamp') + '<br />'
+ storeItem.get('data_nrate') + "%");
}
},
style : {
fill : '#38B8BF'
}
}]
})
return zgAllCityChart;
};
// 创建各地市缺失率折线图形end
Ext.define('Inspur.gsm_cmParam', {
extend : 'Ext.panel.Panel',
id : 'gsm_cmParam',
border : 0,
initComponent : function() { // 初始化gsm工参核查界面
this.callParent();
this.createChartpanel();
Ext.getCmp('chartpanel').add(Ext.getCmp('zgAllCityChartid'));//添加到panel中不显示
this.add(Ext.getCmp('chartpanel'));
//this.add(this.createChartpanel());
this.add(this.createGrid());
},
createChartpanel : function() { // 图形部分
var chartPanel = Ext.create('Ext.panel.Panel', {// myedit
height : '50%',
id : "chartpanel",
// layout:"border",
title : "各地市数据缺失率一览"
});
chartPanel.add(createZgAllCityChart("GSM"));
chartPanel.doLayout();
//return chartPanel;
},
});
openCmWin = function(time, cityName, casetype, fieldName) {
var win = Ext.create('Ext.window.Window', {
title : cityName + "-" + time + "-" + casetype,
height : 500,
width : 1070,
draggable : false,
layout : 'border'
});
if (casetype == 'GSM缺失原因分类明细') {
win.add(createZgCauseGrid(time, cityName, "GSM", fieldName));
win.add(createZgAllCityChart("GSM"));//添加到window组件中正常显示
}
win.show;
}
各地市缺失数据一览中,chart不显示 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询