Skip to content

Component | Stacked Bar: Add stacked spacing option - #611

Draft
dennisadriaans wants to merge 2 commits into
f5:mainfrom
dennisadriaans:feature/stacked-bar-padding
Draft

Component | Stacked Bar: Add stacked spacing option#611
dennisadriaans wants to merge 2 commits into
f5:mainfrom
dennisadriaans:feature/stacked-bar-padding

Conversation

@dennisadriaans

@dennisadriaans dennisadriaans commented Jul 30, 2025

Copy link
Copy Markdown
Contributor

This adds an option to apply spacing between stacked items within a single bar. Applies radius application across all stacked items when a chart-wide radius is set.

@lee00678 lee00678 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dennisadriaans great addition.
I see one small issue (below)

// Only apply spacing between inner segments (not at base or top)
const isInnerStack = accessorIndex > 0 && accessorIndex < this.getAccessors().length
if (!isEntering && stackSpacing > 0 && isInnerStack) {
if (this.isVertical()) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When there are both negative and positive value in the same group,
Screenshot 2025-07-30 at 1 27 44 PM

@dennisadriaans
dennisadriaans force-pushed the feature/stacked-bar-padding branch from 7f81b39 to 88e0d43 Compare August 1, 2025 11:43
@dennisadriaans

Copy link
Copy Markdown
Contributor Author

Spacing, radius and crosshair should be good for both positive and negative values now. The crosshair for horizontal orientation seems bugged, but it looks like this happens in the main branch too

@lee00678

lee00678 commented Aug 5, 2025

Copy link
Copy Markdown
Collaborator

Spacing, radius and crosshair should be good for both positive and negative values now. The crosshair for horizontal orientation seems bugged, but it looks like this happens in the main branch too

Yea, we don't currently support horizontal crosshair.

@lee00678

lee00678 commented Aug 5, 2025

Copy link
Copy Markdown
Collaborator

@dennisadriaans this looks good! It should be nice to have some documentation for this on the website. Do you have bandwidth? If not, I can add it.

@lee00678

lee00678 commented Aug 6, 2025

Copy link
Copy Markdown
Collaborator

Added doc.
Screenshot 2025-08-06 at 12 32 57 PM

@lee00678 lee00678 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

@suryahanumandla

Copy link
Copy Markdown
Collaborator
  • I see spacing is not same for all
image

@lee00678 @rokotyan
what would be the expected behavior when user wants to have roundedCorners along with stackSpacing?

image

@rokotyan

rokotyan commented Aug 7, 2025

Copy link
Copy Markdown
Contributor

@suryahanumandla Great observation about the spacing, thanks for double checking! Also the space at the bottom looks off.

image

what would be the expected behavior when user wants to have roundedCorners along with stackSpacing?

I think the screenshot you've shared looks good. What is your concern?

@dennisadriaans

Copy link
Copy Markdown
Contributor Author

The inconsistent spacing happens when the stackedSpacing is increased. Currently, we subtract the spacing visually from a stacked item to keep it aligned with the value on the y-axis. I'm not sure how to correct this. Any suggestions?

@suryahanumandla

Copy link
Copy Markdown
Collaborator

@dennisadriaans I'll take a look at it, thanks.

@lee00678
lee00678 marked this pull request as draft August 28, 2025 16:54
@lee00678

Copy link
Copy Markdown
Collaborator

I'm converting this to draft until it's ready. cc @dennisadriaans

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants