Skip to content

[Bug]: 外部容器宽度为100%,内部pie组件想要平分3份时legend样式会向左侧移动 #3143

@jierui555

Description

@jierui555

Describe the bug / 问题描述

    <div style={{ flex: '0 0 33%' }}>
      <Pie {...config} />
    </div>

    <div style={{ flex: '0 0 33%' }}>
      <Pie {...config} />
    </div>
  </div>
</div>

采用百分比进行平分,就会有这个问题

Reproduction link / 复现链接

https://stackblitz.com/edit/vitejs-vite-c8b4qiaj?file=src%2Fcharts.jsx

Steps to Reproduce the Bug or Issue / 重现步骤

    <div style={{ flex: '0 0 33%' }}>
      <Pie {...config} />
    </div>

    <div style={{ flex: '0 0 33%' }}>
      <Pie {...config} />
    </div>
  </div>
</div>

采用这个层级形式会复现

Version / 版本

🆕 2.x

OS / 操作系统

  • macOS
  • Windows
  • Linux
  • Others / 其他

Browser / 浏览器

  • Chrome
  • Edge
  • Firefox
  • Safari (Limited support / 有限支持)
  • IE (Nonsupport / 不支持)
  • Others / 其他

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛Something isn't workingplots统计图表G2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions