Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass to yaxis max/min property the min/max values on the selected timeframe #566

Closed
AurelReb opened this issue May 2, 2019 · 3 comments
Closed

Comments

@AurelReb
Copy link
Contributor

AurelReb commented May 2, 2019

Is your feature request related to a problem? Please describe.
Create a function with the min / max properties of yaxis, which would allow us to zoom automatically on the yaxis when we change the xaxis selection.

Describe the solution you'd like
In the function, it would be interesting to add an argument named minOnSelection so that the function looks like this:

{
  yaxis: {
    min: (min, minOnSelection) => //...
    max: (max, maxOnSelection) => //...
  }
}

for example, if a series includes y-values between 1 and 10, but the x-axis scale on this series includes only y-values between 5 and 7, min should be equal to 1 and minOnSelection should be equal to 5

The feature would be handy for many people I think.

@junedchhipa
Copy link
Contributor

We have zoom.autoScaleYaxis property. Unfortunately, this property is not in the docs as it is not finished yet.
As you've already contributed to the initial idea of scaling Y-axis on zooming, I need to make it work for multi-yaxis too.
Thanks for another suggestion!

@junedchhipa
Copy link
Contributor

Added the option chart.zoom.autoScaleYaxis which fixes the above issue.

@mattwensing
Copy link

Can this option also be used somehow for an area type of chart? Here's my options; I'm not seeing the desired behaviour:

      chart: {
        type: 'area',
        stacked: false,
        height: 350,
        zoom: {
          type: 'x',
          autoScaleYaxis: true,
          enabled: true
        },
        toolbar: {
          autoSelected: 'zoom'
        }
      },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants