chartjs / chartjs/chartjs-plugin-zoom

Disable auto zoom-out after toggling datasets, when clicking on the legend.

Open
#817 3 comments 0 reactions 0 assignees View on GitHub
needs test case
Dominant language
JavaScript
Stars
623
Forks
331
Avg merge
7h 5m
Merged PRs (30d)
7

Description

Take the most basic line chart with the zoom plugin and 2 datasets.
1. Zoom in on the chart with both datasets visible.
2. Click on the legend to hide one of the datasets.

Expectations:
The chart zoom level remains the same so that I don't have to zoom in again to whichever data point I was interested in.

Actual result:
The chart is updated and the zoom level is back to the default one.

Findings:
Trying to hook into the onZoomStart and cancel the zoom did not work. The event was not the one being triggered.

Contributor guide

Open the contributing guide

Research direction

Start with the basic line-chart reproduction described in the issue: enable the zoom plugin, zoom in with both datasets visible, then toggle a dataset from the legend. Trace the zoom plugin's response to the chart update and verify that the zoom level remains unchanged after the legend click.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.