How to get value of start
and end
in dataZoom changed event in echarts baidu?
Asked
Active
Viewed 2,107 times
5

Jeffrey Roosendaal
- 6,872
- 8
- 37
- 55

Hobas Matius
- 199
- 1
- 2
- 14
1 Answers
6
Listen to the dataZoom event dispatched by eCharts after the dataZoom has changed.
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
When using eCharts with vue.js library:
Template:
<IECharts @dataZoom="updateZoom"></IECharts>
Code (wrap in methods
):
methods: {
updateZoom(e) {
// See all available properties of the event
console.log(e);
}
}

Jeffrey Roosendaal
- 6,872
- 8
- 37
- 55
-
Hi, where to put this on? Currently I try using `
` and then `updateZoom : function() { ... }` – Hobas Matius Dec 18 '17 at 11:43 -
I've updated my answer. I don't work with vue myself, but maybe this works. Let me know. – Jeffrey Roosendaal Dec 18 '17 at 11:53
-
Hm. Another update, can you try this? Wrap it in the `methods` property, and use `updateZoom(e) {...}` – Jeffrey Roosendaal Dec 19 '17 at 08:22
-
1Just back and test this, and works as charm. thank you so much :) – Hobas Matius Dec 22 '17 at 09:45
-
I'm glad to hear! – Jeffrey Roosendaal Dec 22 '17 at 09:55
-
@HobasMatius Can you please put the code snippet. I tried the above method but it doesn't seems to work. Thank you – Satyam Rai Jan 30 '19 at 13:22