Skip to content

[Bug] when I set dataZoom.moveOnMouseWheel : false and max|minValueSpan, it still can move after arrived the max or min scale. #16635

@life-as-flowers

Description

@life-as-flowers

Version

5.3.0

Link to Minimal Reproduction

No response

Steps to Reproduce

function func(x) {
    x /= 10;
    return Math.sin(x) * Math.cos(x * 2 + 1) * Math.sin(x * 3 + 2) * 50;
}

function generateData() {
    let data = [];
    for (let i = -200; i <= 200; i += 0.2) {
        data.push([i, func(i)]);
    }
    return data;
}

let option = {
    animation: false,
    grid: {
        top: 40,
        left: 50,
        right: 40,
        bottom: 50
    },
    xAxis: {
        name: "x",
        minorTick: {
            show: true
        },
        minorSplitLine: {
            show: true
        },
        splitLine: {
            show: true
        },
    },
    yAxis: {
        name: "y",
        min: -100,
        max: 100,
        minorTick: {
            show: true
        },
        minorSplitLine: {
            show: true
        }
    },
    dataZoom: [
        {
            show: true,
            type: "inside",
            filterMode: "weakFilter",
            xAxisIndex: [0],
            startValue: -20,
            endValue: 20,
            minValueSpan: 20,
            maxValueSpan: 200,
            zoomOnMouseWheel: true,
            moveOnMouseMove: true,
            moveOnMouseWheel: false
        },
        {
            show: true,
            type: "inside",
            filterMode: "none",
            yAxisIndex: [0],
            startValue: -20,
            endValue: 20,
            minValueSpan: 20,
            maxValueSpan: 200,
            zoomOnMouseWheel: true,
            moveOnMouseMove: true,
            moveOnMouseWheel: false
        }
    ],
    series: [
        {
            type: "line",
            showSymbol: false,
            clip: true,
            data: generateData()
        }
    ]
};

export default option;

Current Behavior

when I set dataZoom.moveOnMouseWheel : false and max|minValueSpan, it still can move after arrived the max or min scale.

Expected Behavior

I wish that it cannot move when triiggering mousewheeevent after arrived the max or min scale.Only when I'm movimg the mosue, it can move the view.

Environment

- OS: win7
- Browser: chrome 99
- Framework: Vue 2.6.11

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugenThis issue is in EnglishpendingWe are not sure about whether this is a bug/new feature.

    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