antvis / antvis/G2Plot

🐛 [BUG] 分组柱状图仅有一组数据时,与dodgePadding属性冲突,导致不渲染柱图

Open
#3,626 3 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
分组柱状图仅有一组数据时,与dodgePadding属性冲突,导致不渲染柱图

### 📷 Step to reproduce
```js
import { Column } from '@antv/g2plot';

const data = [
{
name: 'London',
月份: 'Jan.',
月均降雨量: 18.9,
},
{
name: 'Berlin',
月份: 'Jan.',
月均降雨量: 12.4,
},
];

const plot = new Column('container', {
data,
isGroup: true,
dodgePadding: 40,
xField: '月份',
yField: '月均降雨量',
seriesField: 'name',
interactions: [{ type: 'element-selected' }]
});

plot.render();
```
![image](https://github.com/antvis/G2Plot/assets/29271740/b07e2c23-6927-44af-886b-d51807adb686)

### 🏞 Expected result
![image](https://github.com/antvis/G2Plot/assets/29271740/1be67fd7-a3b7-4df8-9fef-1aa0b8d403fd)

### 🚑 Any additional [like screenshots]

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

Contributor guide

Open the contributing guide

Research direction

Start from the Column entry point and reproduce the configuration shown with one data group, isGroup enabled, and dodgePadding set to 40. Compare the rendered result with the expected screenshot, then verify that the grouped column renders correctly without removing dodgePadding. Confirm the fix with the provided reproduction case.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.