1

I am using Ant Design Charts to create a stacked bar but I want it to be responsive. When I am removing data items, the bars get too thick to fill the available space. So basically, I want the bars to have fixed height so that they don't get too thick when there are few data items. Please find below the relevant images:

enter image description here enter image description here

Here is the link to ant design chart:

https://charts.ant.design/en/examples/bar/stacked#basic

1 Answers1

3

You can use pass maxBarWidth prop to bar config like this:

config = {
    maxBarWidth: 30,
    ...

Or directly to the Bar component like this:

<Bar {...config} maxBarWidth={30} />
Ahmet Emre Kilinc
  • 5,489
  • 12
  • 30
  • 42