ant-design / ant-design-charts

A React Chart Library
https://ant-design-charts.antgroup.com/
MIT License
1.91k stars 361 forks source link

🧐[问题] How to set separate sizes of ranges, measures, targets of Bullet chart? #2655

Open ekeijl opened 1 month ago

ekeijl commented 1 month ago

🧐 问题描述 [详细地描述问题,让大家都能理解]

I can set the size of all lines/bars with the sizeField: number on the Bullet chart.

How do I set separate sizes for ranges, measures and targets? This does not work:

const config = {
   data,
   color,
   sizeField: {
       ranges: 10,
       measures: 5,
       targets: 3
   }
}

return <Bullet {...config} />;

💻 示例代码 [如果有必要,展示代码,线上示例,或仓库]

https://codesandbox.io/p/sandbox/proud-sky-7wrfz4

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

In v1.0 this was possible by setting bulletStyle.

ekeijl commented 1 month ago

Oh, I found it in this example:

    range: {
      sizeField: 50,
    },
    measure: {
      sizeField: 15
    },
    target: {
      sizeField: 25
    }