imaNNeo / imaNNeo/fl_chart

BarChart: Is there a possibility to "shrinkWrap" the chart?

Open
#1,961 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
7.6k
Forks
2k
Avg merge
9d 1h
Merged PRs (30d)
2

Description

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):

Image

My current achievement looks like this:

Image

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`?

Contributor guide

Open the contributing guide

Research direction

Start with the BarChart widget and the groupSpace behavior described in the issue. Determine how the chart currently sizes its horizontal content and define a supported way for it to use only the required width while preserving group spacing and aligned axes.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.