🐛 [BUG] Calling changeData with a DualAxes chart causes legend to be hidden and animation to be replayed
- Dominant language
- TypeScript
- Stars
- 2.7k
- Forks
- 591
- PR merge metrics
- No merged PRs in 30d
Description
### 🐛 Bug description [Please make everyone to understand it]
> Please provide a link by forking these links [G2Plot](https://codesandbox.io/s/g2plot-issue-template-gzfdq?file=/index.ts) or GitHub repo, a minimal reproduction.
* _Required_ **Link to minimal reproduction**:
https://codesandbox.io/s/x61ucc?file=/index.ts (See also the expected behavior in other charts, like Line, in https://codesandbox.io/s/kind-kare-hluk3l?file=/index.ts, which retains the legend when `.changeData` is called)
### 📷 Step to reproduce
- Create any DualAxes chart
- Call chart.changeData while hovered over the chart
- Legend is no longer displayed
- Animation is replayed
### 🏞 Expected result
- Legend stays on the screen
- Only new parts of the chart are redrawn
### 🚑 Any additional [like screenshots]
- The legend is still lost even when animation is set to false
**G2Plot Version**:
2.4.19
**Platform**:
Chrome
Contributor guide
Research direction
Start with index.ts in the linked DualAxes CodeSandbox reproduction and run the chart while hovering, then call changeData. Compare its behavior with the linked Line example; done means the legend remains visible and animation is not replayed, including when animation is false.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100