5

How to get value of start and end in dataZoom changed event in echarts baidu?

Jeffrey Roosendaal
  • 6,872
  • 8
  • 37
  • 55
Hobas Matius
  • 199
  • 1
  • 2
  • 14

1 Answers1

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

Documentation on IEcharts

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