我得到了一個包含dataZoom組件的圖表。 x軸的類型爲time
。 縮放和漫遊圖表完美無缺。但是,當我偵聽dataZoom
事件掛鉤縮放過程時,我只能從事件獲取百分比值(0-100)作爲當前位置。echarts dataZoom事件不返回時間戳,但只有百分比
的dataZoom配置:
dataZoom: {
start: 0,
end: 3,
showDetail: false
}
我的X軸的配置:
xAxis: {
type: 'time',
boundaryGap: false,
splitLine: {
show: true,
lineStyle: {
color: '#ddd',
type: 'dashed'
}
},
axisLine: {
show: false
}
},
我聽這樣的事件:
myChart.on('dataZoom', function (evt) {
console.log('zoom', evt);
})
我也得到了evt
此控制檯輸出:
{
"type": "datazoom",
"from": "viewComponent_17_0.8229841241707196",
"dataZoomId": "\u0000\u0000-\u00000",
"start": 1.6141473287753287,
"end": 11.178346465795
}
我希望它是這樣的:
"start" : "2012-12-01 15:30:00Z",
"end" : "2012-12-01 15:40:00Z"
這可能嗎?