Skip to content

[Feature] How to get the axis range when datazoom scales it? #17919

Description

@masq6r

What problem does this feature solve?

Hopefully the axis range could be known when it's changed.
I have y-axis scale set to true, and enabled datazoom. When I zoom or pan the chart, clearly the y-axis's range changes too. Now I need to know the new range.
I tried to listen to datazoom event but it doesn't look like any properties in the option could give me the values.

chart.on("datazoom", params => console.log(chart.getOption().yAxis[0]))

From the output I cannot see any information showing the y-axis range. Is there a way I can get it?

What does the proposed API look like?

Add a range property in the yAxis option:

yAxis: {
    range: [currentMin: number, currentMax: number]
}

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enThis issue is in Englishsupport

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions