Skip to content

datazoom does not return start and end values #10381

@Kafty

Description

@Kafty

Version

4.1.0-release

Reproduction link

https://ecomfe.github.io/echarts-examples/public/editor.html?c=doc-example/getting-started

Steps to reproduce

Please copy this into input on the left side.

// please copy this :)

option = {
    title: {
        text: 'ECharts 入门示例'
    },
    tooltip: {},
    legend: {
        data:['销量']
    },
    xAxis: {
        data: ["衬衫","羊毛衫","雪纺衫","裤子","高跟鞋","袜子"]
    },
    yAxis: {},
    series: [{
        name: '销量',
        type: 'bar',
        data: [5, 20, 36, 10, 10, 20]
    }],
    toolbox: {
        feature: {
            restore: {
                title: 'Restore',
            },
            dataZoom: {
                title: {
                    zoom: 'Zoom',
                    back: 'Back',
                    clear: 'Back',
                },
                restore: {
                    title: 'Restore',
                },
            },
        },
    },
    dataZoom: [
        {
            type: 'inside',
            show: true,
            zoomOnMouseWheel: false,
            moveOnMouseMove: false,
        },    
    ]
};

myChart.on('dataZoom', function (params) {
    console.log(params);
    
    // should return percentage values, but returns undefined
    console.log(params.batch[0].start);
    console.log(params.batch[0].end);
});

myChart.on('dataZoom', function (params) {
    console.log(params);
    
    // should return percentage values, but returns undefined
    console.log(params.batch[0].start);
    console.log(params.batch[0].end);
});

then try to zoom graph, and then have a look into console

What is expected?

I thought, the dataZoom event (triggered after zooming the graph using the toolbox buttons) would return start and end values in percent

What is actually happening?

start and end (percents) returns undefined. Values are not included in the payload of an event.


Thank you :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementstaleInactive for a long time. Will be closed in 7 days.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions