2017-12-18 279 views

回答

2

收听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); 
    } 
} 

Documentation on IEcharts

+0

嗨,往哪里放这个吗?目前我尝试使用''然后'updateZoom:function(){...}' –

+0

我已经更新了我的答案。我不用vue自己工作,但也许这是有效的。让我知道。 –

+0

嗨,我试过这个,它显示'未定义'。 –

相关问题