如何获取dataZoom中的开始和结束值echarts baidu中更改了事件?
答
收听dataCoom发生变化后由eCharts调度的dataZoom事件。
myChart.on('dataZoom', function(e) {
console.log(e); // All params
console.log(e.start); // Start value
console.log(e.end) // End value
});
Documentation on dataZoom event
当使用带vue.js库eCharts:
模板:
<IECharts @dataZoom="updateZoom"></IECharts>
代码(在methods
涡卷):
methods: {
updateZoom(e) {
// See all available properties of the event
console.log(e);
}
}
嗨,往哪里放这个吗?目前我尝试使用' '然后'updateZoom:function(){...}' –
我已经更新了我的答案。我不用vue自己工作,但也许这是有效的。让我知道。 –
嗨,我试过这个,它显示'未定义'。 –