EXTJS chart 无法显示

fgh0302 2014-04-01 04:58:40
在后台测试没问题,发布出来就不行,用火狐也没搜到网上说的网络包中是否请求了http://yui.yahooapis.com/2.8.2/build/charts/assets/charts.swf


//柱型图数据源
var Get_Month_Teu_Store = new Ext.data.JsonStore({
fields: ['name', 'visits', 'views'],
root: "data",
url: 'PublicFunction/DAL_PublicFunction.aspx?type=Get_Month_Teu'
});
Get_Month_Teu_Store.load();

//饼图数据源
var Get_Container_By_Teu_Store = new Ext.data.JsonStore({
fields: ['name', 'views'],
root: "data",
url: 'PublicFunction/DAL_PublicFunction.aspx?type=Get_Container_By_Teu'
});
Get_Container_By_Teu_Store.load();

var welcomePanel = new Ext.Panel({
title: '工作台',
layout: 'table',
style: 'margin-left:0px;',
border: false,
iconCls: 'chart',
autoScroll: true,
defaults: {
bodyStyle: 'padding:6px;margin-top:7px;margin-right:10px;text-align:right;border:0px;'
},
layoutConfig: {
columns: 1
},
items: [new Ext.Panel({
layout: 'table',
style: 'margin-left:0px;',
border: false,
iconCls: 'chart',
defaults: {
bodyStyle: 'padding:6px;margin-top:7px;margin-right:10px;text-align:right;border:0px;'
},
layoutConfig: {
columns: 3
},
items: [new Ext.Panel({
title: '箱量走势',
width: 400,
items: [{
xtype: 'columnchart',
width: 360,
//柱形图
store: Get_Month_Teu_Store,
url: 'js/charts.swf',
xField: 'name',
yAxis: new Ext.chart.NumericAxis({
displayName: 'visits',
labelRenderer: Ext.util.Format.numberRenderer('0')
}),
tipRenderer: function(chart, record, index, series) {
if (series.yField == 'visits') {
return Ext.util.Format.number(record.data.visits, '0.0') + ' visits in ' + record.data.name;
} else {
return Ext.util.Format.number(record.data.views, '0.0') + ' page views in ' + record.data.name;
}
},
chartStyle: {
padding: 10,
animationEnabled: true,
font: {
name: 'Tahoma',
color: 0x444444,
size: 11
},
dataTip: {
padding: 5,
border: {
color: 0x99bbe8,
size: 1
},
background: {
color: 0xDAE7F6,
alpha: .9 // 透明度
},
font: {
name: 'Tahoma',
color: 0x15428B,
size: 10,
bold: true
}
},
xAxis: {
color: 0x69aBc8,
majorTicks: {
color: 0x69aBc8,
length: 4
},
minorTicks: {
color: 0x69aBc8,
length: 2
},
majorGridLines: {
size: 1,
color: 0xeeeeee
}
},
yAxis: {
color: 0x69aBc8,
majorTicks: {
color: 0x69aBc8,
length: 4
},
minorTicks: {
color: 0x69aBc8,
length: 2
},
majorGridLines: {
size: 1,
color: 0xdfe8f6
}
}
},
series: [{
type: 'column',
displayName: 'Page Views',
yField: 'views',
style: {
image: 'bar.gif',
mode: 'stretch',
color: 0x99BBE8
}
},
{
type: 'line',
displayName: 'Visits',
yField: 'visits',
style: {
color: 0x15428B
}
}]
}]
}), new Ext.Panel({
weight: 20
}), new Ext.Panel({
title: '箱属分布',//饼图
width: 400,
items: [{
xtype : 'piechart',
url: 'js/charts.swf',
store : Get_Container_By_Teu_Store,
categoryField : 'name',
dataField : 'views',
listeners : {
itemclick : function(o) {
var rec = store.getAt(o.index);
showTwo(rec.get('name'));
}
},
extraStyle : {legend : {display : 'bottom',padding : 5,font : {family : 'Tahoma',size : 13}}}}
]
})]

}), new Ext.Panel({
layout: 'table',
style: 'margin-left:0px;',
border: false,
iconCls: 'chart',
defaults: {
bodyStyle: 'padding:6px;margin-top:7px;margin-right:10px;text-align:right;border:0px;'
},
layoutConfig: {
columns: 3
},
items: [new Ext.Panel({
title: '箱量走势',
width: 400
}), new Ext.Panel({
weight: 20
}), new Ext.Panel({
title: '箱量走势',
width: 400
})]

})]

});

var centerRegion = new Ext.TabPanel({

region: 'center',
deferredRender: false,
activeTab: 0,
enableTabScroll: true,
ayoutOnTabChange: true,

listeners: {
remove: function(tp, c) {
c.hide();
},
bodyresize: function() {}
},
autoDestroy: false,
items: [welcomePanel],
plugins: new Ext.ux.TabCloseMenu()

});
...全文
179 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
fgh0302 2014-04-02
  • 打赏
  • 举报
回复
我晕一个回复的没有 csdn 失守了吗?

52,797

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Ajax
社区管理员
  • Ajax
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧