Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

分组条形图柱子间距 [BUG] #3014

Open
lethe-river opened this issue Dec 9, 2021 · 4 comments
Open

分组条形图柱子间距 [BUG] #3014

lethe-river opened this issue Dec 9, 2021 · 4 comments
Labels
Bug Something isn't working

Comments

@lethe-river
Copy link

🐛 Bug description [Please make everyone to understand it]

Please provide a link by forking these links G2Plot or GitHub repo, a minimal reproduction.

  • Required Link to minimal reproduction:

📷 Step to reproduce

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

image

🚑 Any additional [like screenshots]

  • G2Plot Version: 2.3.40
  • Platform: win10 64
@lethe-river lethe-river added the Bug Something isn't working label Dec 9, 2021
@Eve-Sama
Copy link
Contributor

标题没有内容吗?

@lethe-river
Copy link
Author

标题没有内容吗?

image
显示是这样的

@Eve-Sama
Copy link
Contributor

我是说issue标题.

@lethe-river lethe-river changed the title 🐛 [BUG] 分组条形图柱子间距 [BUG] Dec 10, 2021
@lethe-river
Copy link
Author

我是说issue标题.

抱歉,刚刚改了标题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants