imaNNeo / imaNNeo/fl_chart

Request for Feature: Rounded Corners for Stacked Bar Chart Rods

Open
#1,888 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

**Description**: I am currently working with the `fl_chart` package and am trying to implement a stacked bar chart where each individual bar (or segment) in the stack has rounded corners. While the package provides an excellent feature set, I am not sure if there is a built-in way to apply rounded corners to each individual segment of a stacked bar.

Problem: I need to create a stacked bar chart where each stacked segment has rounded corners on both the top and bottom. However, it seems that the current version of the package does not allow for this behavior directly.

**Expected Behavior:**

Each `BarChartRodStackItem` (or the individual segments of a stacked bar) should support having rounded corners applied to both the top and bottom of each segment.

**Current Implementation:** I have attempted to apply rounded corners using the `borderRadius` property on `BarChartRodData`, but this only seems to work for individual bars and not for stacked bars. Here is the code snippet I tried:

`BarChartRodStackItem(0, 2.0, CustomColors.teal),
BarChartRodStackItem(2.0, 4.0, CustomColors.magenta),
`

In addition to that, I tried to implement `borderRadius` at the `WhiskerBarChartBarData` level, but the results were not as expected, with only some parts of the bars having rounded corners.

Feature Request: Could you confirm if rounded corners for stacked bar segments are supported in the current version of `fl_chart`? If not, is there any plan to add this feature in future releases?

If it's not supported, would you be able to suggest an alternative approach or possible workaround to achieve rounded corners for stacked bars?

Contributor guide

Open the contributing guide

Research direction

Inspect BarChartRodStackItem and BarChartRodData, then trace the stacked-bar rendering path to determine where segment corner geometry is formed. Done means each stack segment visibly supports rounded top and bottom corners, including the provided two-segment example; add or update relevant coverage if the repository has it.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
data-visualization, frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.