BarChart: Is there a possibility to "shrinkWrap" the chart?
Hi,
at the moment, the BarChart seems to use any available horizontal space.
Is there a possibility to turn this around, so it draws the horizontal size it requires, but not more?
I'm trying to implement this chart (screenshot from Figma):
My current achievement looks like this:
As you can see the horizontal lines span the full available width. The axis is also separated from the chart due to that.
I want to use the groupSpace so I can define the space between each group. Any other placement is not what I need.
So, the issue is, that the chart uses more space than it actually needs.
Is there a way to render it only in the size it really needs, or do I need to calculate that beforehand and put the chart into a SizedBox?
Hello 👋
There doesn't seem to be anything on the BarChart or BarChartData classes to manipulate the space/width.
My guess is that at the moment you just have to wrap it in something with a fixed size, like a SizedBox.
It would be pretty useful if there was a shrinkWrap option on the chart data classes to only take up the necessary space though! 😊