代码之家  ›  专栏  ›  技术社区  ›  Hobas Matius

如何在易趣百度的dataZoom更改事件中获取开始和结束值?

  •  4
  • Hobas Matius  · 技术社区  · 7 年前

    如何获得的价值 start end 在易趣百度的dataZoom更改事件中?

    1 回复  |  直到 7 年前
        1
  •  5
  •   Jeffrey Roosendaal SReddy    7 年前

    在dataZoom发生更改后,侦听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


    将eCharts与vue一起使用时。js库:

    模板:

    <IECharts @dataZoom="updateZoom"></IECharts>
    

    代码(换行 methods ):

    methods: {
        updateZoom(e) {
            // See all available properties of the event
            console.log(e);
        }
    }
    

    Documentation on IEcharts