ext linechart 横坐标是时间轴,怎么加事件可是使时间变成时分格式呢

cfcf509 2010-06-02 02:01:59

/*gridstore.fields=[
{
//似乎有bug,labelfunction不好用,就自己处理一个field来当x轴标签
name:'gatherTime',
mapping:'gatherTime',
convert:function(v,record){
return Date.parseDate(v, 'Y-m-d H:i:s').format('H:i');
alert("1213143254");
}
},
{name:'gatherTime',type:'date',dateFormat:'Y-m-d H:i:s'}
]*/
var linechar= new Ext.Panel({
title: checkboxname+'曲线图',
// renderTo: document.body,
collapsible : true,
layout:'fit',
closeAction:'hide',
plain: true,
height:150,
items: {
xtype: 'linechart',
store: gridstore,
url: '/QT_CMS/ext/resources/charts.swf',
// xField: 'gatherTime',
//yField: checkboxvalue,
listeners: {
itemclick: function(o){
var rec = gridstore.getAt(o.index);
Ext.example.msg('Item Selected', 'You chose {0}.', rec.get('resFullName'));
}
},
series: [{
type:'line',
// displayName: '告警',
xField: 'gatherTime',
style:{size: 2} ,
yField: checkboxvalue
/* style: {
color: 0x15428B
} */
}],
//定义图表样式
chartStyle: {
//不知道为啥没出来这个图示
/* legend:{
display: "top"
},*/
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}
}
}
}
});
return linechar;
后台给我的时间是年月日 时分秒 ,而且我的数据源store是曲线图和grid共用一个,由于含有变量无法使用fileds映射,我怎么使横坐标只有时分呢
...全文
245 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
upup1000 2010-06-18
  • 打赏
  • 举报
回复
xAxis:{
labelRenderer : function(v){
在这里边对v进行处理,返回相应的串就可以了
}
}

81,092

社区成员

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

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