大家进来帮忙分析一下我这个extjs折线图页面有什么地方错误了

凌益与零 2013-12-04 10:09:24
页面代码如下:
<script type="text/javascript">
Ext.onReady(function() {
//创建一个Store
var store = Ext.create('Ext.data.JsonStore', {
fields : ['date','price1','price2','price3','price4'],
proxy:{
type:'ajax',
url:'chartSearch',
reader:{
type:'json'
}
}
});
//创建图表对象
var monthHistogram = Ext.create('Ext.panel.Panel', {
renderTo : Ext.getBody(),
title : '价格统计图',
border:false,
tbar : [ '时间',{
xtype:'combo',
format:'Y-M',//显示类型
name:'month',
id:'month',
store:['2013-07','2013-08','2013-09','2013-10','2013-11','2013-12','2014-01'],
emptyText:'2013-12',
editable : false
},'银行类别:', {
xtype : 'combo',
name : 'bankType',
id : 'bankSearch',
store : ['国股','北上南宁','省会城商','全国城商','外资','农商农合','信用社村镇'],
emptyText:'国股',
editable : false
}, '-', {
text : '查询',
handler : function() {
store.load({
params : {
'month':Ext.getCmp('month').getValue(),
'bankType' : Ext.getCmp('bankSearch').getValue()
}
});
}
} ],
items :{
xtype:'chart',
store : store,
axes : [ {//定义坐标轴
title : 'Price', //纵轴标题
type : 'Numeric',
position : 'left',
fields : [ 'price' ],
majorTickSteps:15,
minorTickSteps:1
}, {
title : 'Time',
type : 'Time',
position : 'bottom',
fields : [ 'date' ],
dateFormat : 'd'
} ],
series : [ {
type : 'line',
displayName : '小票买断价',
xField : 'date',
yField : 'price1',
style : {
color : 0xCCFF00
}
}, {
type : 'line',
displayName : '大票买断价',
xField : 'date',
yField : 'price2',
style : {
color : 0xCC0000
}
}, {
type : 'line',
displayName : '当天出款价',
xField : 'date',
yField : 'price3',
style : {
color : 0x0033FF
}
}, {
type : 'line',
displayName : '带票价',
xField : 'date',
yField : 'price4',
style : {
color : 0x66CC00
}
} ]
}
});

store.load({
params : {
'month':'2013-12',
'bankType' : '国股'
}
});
})
</script>

后台取到json数据格式如下:
[{"date":1,"price1":"","price2":6.12,"price3":"","price4":""},{"date":2,"price1":"","price2":6.12,"price3":"","price4":6},
{"date":3,"price1":"","price2":6.08,"price3":"","price4":5.92},
{"date":4,"price1":"","price2":6.08,"price3":"","price4":""},...余下省略]

页面实现效果如下:



求教,为什么我的extjs折线图没有实现出来啊,这数据都取到了啊
...全文
217 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
楼主这个问题解决了没,我也遇到这个问题了
凌益与零 2013-12-04
  • 打赏
  • 举报
回复
求详解啊,这我把var store 和store.load改成var chartStore和chart.load,可是还是不好使啊,折线图还是没显示
凌益与零 2013-12-04
  • 打赏
  • 举报
回复
是这边的store和上面的var store还有store : ['国股','北上南宁','省会城商','全国城商','外资','农商农合','信用社村镇']重复了?
  • 打赏
  • 举报
回复
store:['2013-07','2013-08','2013-09','2013-10','2013-11','2013-12','2014-01']

25,980

社区成员

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

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