Skip to content

🐛[BUG]legend的cols不生效 #2848

Open
@qingfengmy

Description

@qingfengmy

🐛 bug 描述 [详细地描述 bug,让大家都能理解]

不设置cols时

Image

设置cols时

Image

📷 复现步骤 [清晰描述复现步骤,让别人也能看到问题]

const DemoPie = () => {
  const config = {
    data,
    angleField: 'value',
    colorField: 'type',
    radius: 0.8,
    label: {
      text: (d) => `${d.type}\n ${d.value}`,
      position: 'spider',
    },
    legend: {
      color: {
        // title: false,
        position: 'bottom',
        cols: 1,  
        maxRows: 2,
        // autoWrap: true,
        layout: {
          justifyContent: 'center',
          // alignItems: 'center',
          // flexDirection: 'row',
        },
      },
    },
  };
  return <Pie {...config} />;
};

🏞 期望结果 [描述你原本期望看到的结果]

我设置cols为1,maxRows为2时,两行一列去分页

💻 复现代码 [提供可复现的代码,仓库,或线上示例]

© 版本信息

  • ant-design-charts 版本: [e.g. 0.9.0]
  • 浏览器环境
  • 开发环境 [e.g. mac OS]

🚑 其他信息 [如截图等其他信息可以贴在这里]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions