chartjs / chartjs/chartjs-plugin-zoom

Feature request: Add maxRange option

Open
#756 2 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
623
Forks
331
Avg merge
7h 5m
Merged PRs (30d)
7

Description

Hi,

You already have minRange option hear:
```ts
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:
```ts
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!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.