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

Feature request: Add maxRange option #756

Open
iliubinskii opened this issue May 9, 2023 · 2 comments
Open

Feature request: Add maxRange option #756

iliubinskii opened this issue May 9, 2023 · 2 comments

Comments

@iliubinskii
Copy link

Hi,

You already have minRange option hear:

export interface ScaleLimits {
  min?: number | 'original';
  max?: number | 'original';
  minRange?: number;
}

I see the reason why you didn't add maxRange. This is because you assumed that user starts from seeing all the data. So, there is no reason to limit him in returning to this initial state.

However, chart.js has min/max options:

  scales: {
    x: { min: 0, max: 20 },
    y: { min: 0, max: 100 }
  }

In this case the chart will start from showing 20 points, even if data contains 10000 points.

Then I may want to zoom in to 10 points at most and to zoom out to 1000 points at most.
I may use minRange range for the first (10 points min).
And I could use maxRange for the second (1000 points max).

Thank you for great plugin!

@iliubinskii
Copy link
Author

I reloaded submitted form several times because I was getting error from GitHub. And it appears that I actually created several duplicate tickets. Already closed duplicates. Sorry.

@kurkle
Copy link
Member

kurkle commented May 9, 2023

I guess nobody wanted to limit the maxRange below min/max before. Sounds like a reasonable addition to me.

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

No branches or pull requests

2 participants