fl_chart icon indicating copy to clipboard operation
fl_chart copied to clipboard

Request for Feature: Rounded Corners for Stacked Bar Chart Rods

Open NJashwanth opened this issue 8 months ago • 1 comments

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?

NJashwanth avatar Apr 01 '25 20:04 NJashwanth

Also it would be great to be able to define gradient for BarChartRodStackItem

sinelser avatar May 11 '25 21:05 sinelser