我使用折线图,
xAxis: {
type: 'time',
...
tooltip: {
trigger: 'item',
formatter: '{a},' +new Date(Date.parse({c})).Format("yyyy-MM-dd hh:mm:ss"), {d}(无)',
无法格式化时间格式,因为formatter是字符串,
无
可以根据需求格式化时间格式
option = {
}
var option{$k} = {
title: {
text: '{$key}'
},
tooltip: {
trigger: 'item',
formatter: '{a},' +new Date(Date.parse({c})).Format("yyyy-MM-dd hh:mm:ss"), {d}(无)',
axisPointer:{
show: true,
type : 'shadow',
lineStyle: {
type : 'dashed',
width : 1
}
}
},
toolbox: {
show : true,
feature : {
mark : {show: true},
dataZoom : {show: true},
dataView : {show: true, readOnly: true,
},
restore : {show: true},
saveAsImage : {show: true,
type : 'png',
name : '{$key} {$linedata_starttime} 至 {$linedata_endtime}',
}
}
},
xAxis: {
type: 'time',
splitLine: {
show: true
}
},
yAxis: {
type: 'value',
min: 'dataMin',
boundaryGap: [0, '100%'],
splitLine: {
show: true
}
},
dataZoom: [{
type: 'inside',
start: 0,
end: 100
}, {
start: 0,
end: 10
}],
series: [
<volist name="vo" id="v">
{
name: '{$v.flag|strtoupper}({$v.name})',
type: 'line',
data: [
<volist name="v.data" id="vi">
[new Date("{$vi.dt}"),{$vi.num}],
</volist>
]
},
</volist>
]
};
用回调函数方式,看文档。
tooltip:{
type : 'cross',
lineStyle: {
type : 'dashed',
width : 1
}
}
...
xAxis: {
type: 'time',
当配置为这种情况时, 回调函数无效,请问这种情况有解决方法吗?