Skip to content

fix: bar and area chart stacked toggle not working - #557

Open
Ju4n5e wants to merge 1 commit into
Make-md:mainfrom
Ju4n5e:fix/bar-chart-stacked-toggle
Open

fix: bar and area chart stacked toggle not working#557
Ju4n5e wants to merge 1 commit into
Make-md:mainfrom
Ju4n5e:fix/bar-chart-stacked-toggle

Conversation

@Ju4n5e

@Ju4n5e Ju4n5e commented Aug 21, 2026

Copy link
Copy Markdown

Summary

  • Fixes the stacked toggle having no effect on bar and area charts
  • The UI toggle sets config.stacked, but BarChartTransformer and AreaChartTransformer only checked config.mark?.stack (which is never set by the config parser)
  • Added || config.stacked === true to both transformers so the toggle takes effect

Fixes #556

Details

The config parser (vizConfigFromProps) maps the stacked UI property to config.stacked (top-level). However, both BarChartTransformer.transform() (line 140) and AreaChartTransformer.transform() (line 98) only check config.mark?.stack, which is never populated.

The legacy render path in D3VisualizationEngine correctly checks the top-level config.stacked, but the newer renderWithTransformedData path (which takes priority when transformedData exists) relies on the transformers, which miss it.

Test plan

  • Create a bar chart with a color field (e.g., grouping by Priority)
  • Toggle Stacked to On — bars should stack vertically instead of side-by-side
  • Toggle Stacked to Off — bars should return to grouped (side-by-side)
  • Repeat with an area chart to verify the same fix

🤖 Generated with Claude Code

The UI stacked toggle sets `config.stacked` but BarChartTransformer
and AreaChartTransformer only checked `config.mark?.stack`, which is
never set by the config parser (vizConfigFromProps). This caused
stacked bars/areas to always render as grouped.

Also check `config.stacked` so the toggle takes effect.

Fixes Make-md#556

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Bar chart stacked toggle has no effect — BarChartTransformer checks mark.stack instead of config.stacked

1 participant