chartjs / chartjs/chartjs-plugin-zoom
Zoom reset for scales built with suggestedMin and suggestedMax
- Dominant language
- JavaScript
- Stars
- 623
- Forks
- 331
- Avg merge
- 7h 5m
- Merged PRs (30d)
- 7
Description
Hello,
Trying to summarize as much as possible, we have the following use case:
1. A chart with two 'y' scales - both scales are created using the 'suggestedMin' and 'suggestedMax' properties
2. Starts to zoom in
3. Hides the scale and datasets of one of the 'y' scales - this is done via the native legend plugin of chartjs
4. Resets zoom (this.chart.resetZoom()) - zoom is reset
5. Observing the onZoomComplete callback, the previously hidden scale now has a 'min'=0 and 'max'=1
- The expectation would be that the scale would have the initial values
If the chart scales are build using the 'min' and 'max' properties instead of the 'suggestedMin' and 'suggestedMax' (point 1), then the expectation is correctly met.
Thank you.
Contributor guide
Research direction
Reproduce the two-y-scale scenario using suggestedMin and suggestedMax, then trace resetZoom and the onZoomComplete callback while hiding one scale and its datasets through the native legend plugin. Done means resetting zoom restores the hidden scale's initial suggested bounds instead of min=0 and max=1.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- chart.js, javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100