G2Plot icon indicating copy to clipboard operation
G2Plot copied to clipboard

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

Open liuzhaoxu1996 opened this issue 2 years ago • 3 comments

🐛 Bug description

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

📷 Step to reproduce

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

🏞 Expected result

image

🚑 Any additional [like screenshots]

  • G2Plot Version:
  • Platform:

liuzhaoxu1996 avatar Jul 26 '23 10:07 liuzhaoxu1996

这个我也遇到过,只能暂时去掉dodgePadding这个属性

z1120635455 avatar Jul 31 '23 06:07 z1120635455

2024年了 有解决方法了吗

ryanuo avatar Oct 14 '24 07:10 ryanuo

2025了,这个bug也不修复啦

wilsunson avatar Aug 28 '25 10:08 wilsunson