antvis / antvis/G2Plot

🐛 [BUG]Funnel Chart update theme console will report:TypeError: Cannot read properties of undefined (reading 'length')

Open
#3,615 0 comments 0 reactions 0 assignees View on GitHub
Bug
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**:

### 📷 Step to reproduce
import { Funnel } from '@antv/g2plot';

const data = [
{ stage: '简历筛选', number: 253 },
{ stage: '初试人数', number: 151 },
{ stage: '复试人数', number: 113 },
{ stage: '录取人数', number: 87 },
{ stage: '入职人数', number: 59 },
];

const funnelPlot = new Funnel('container', {
data: data,
xField: 'stage',
yField: 'number',
legend: false,
});
funnelPlot.update({ theme: 'default' });
funnelPlot.render();

### 🏞 Expected result
Funnel Chart update theme console will report:TypeError: Cannot read properties of undefined (reading 'length')
### 🚑 Any additional [like screenshots]
![image](https://github.com/antvis/G2Plot/assets/21325727/21bb220f-59e1-47f7-9f6e-fe16912cf022)

* **G2Plot Version**: 2.4.31
* **Platform**:

Contributor guide

Open the contributing guide

Research direction

Start with the Funnel example in the issue and reproduce the failure using G2Plot 2.4.31, focusing on the update({ theme: 'default' }) call before render. Trace the undefined value that leads to the length error; done means updating the theme and rendering no longer logs the TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.