分组条形图柱子间距 [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
```js
import { Bar } from '@antv/g2plot';
const data = [
{
label: 'Mon.',
type: 'series1',
value: 2800,
},
{
label: 'Mon.',
type: 'series2',
value: 2260,
},
];
const stackedBarPlot = new Bar('container', {
data,
isGroup: true,
xField: 'value',
yField: 'label',
seriesField: 'type',
dodgePadding: 4,
label: {
// 可手动配置 label 数据标签位置
position: 'middle', // 'left', 'middle', 'right'
// 可配置附加的布局方法
layout: [
// 柱形图数据标签位置自动调整
{ type: 'interval-adjust-position' },
// 数据标签防遮挡
{ type: 'interval-hide-overlap' },
// 数据标签文颜色自动调整
{ type: 'adjust-color' },
],
},
});
stackedBarPlot.render();
```
当data数据只有一组时,显示空白;将dodgePadding: 4, 删除后,则显示正常
### 🏞 Expected result

### 🚑 Any additional [like screenshots]
* **G2Plot Version**: 2.3.40
* **Platform**: win10 64
Contributor guide
Research direction
Start with the provided Bar configuration and minimal reproduction, focusing on grouped-bar layout when only one series is present and dodgePadding is set. Reproduce the blank chart in G2Plot 2.3.40, then trace the grouped layout entry point to identify the affected behavior. Done means the single-series grouped bar renders correctly with dodgePadding while existing grouped cases remain unchanged.
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
- 38/100