Bug Description
The Stacked toggle on bar charts (the layers icon in the chart context menu) has no effect. Bars always render side-by-side (grouped) regardless of the stacked setting.
Root Cause
In src/core/react/components/Visualization/transformers/BarChartTransformer.ts, line 140:
const isStacked = config.mark?.stack === true;
This checks config.mark.stack, but the UI toggle and the config parser (vizConfigFromProps) set the top-level config.stacked property — never config.mark.stack. So isStacked is always false.
The type definitions in src/shared/types/visualization.ts confirm both properties exist:
mark.stack?: boolean (line 51) — never set by the UI
stacked?: boolean (line 187) — set by the UI toggle
The legacy renderLegacy path in D3VisualizationEngine.tsx correctly checks the top-level stacked property, but the newer renderWithTransformedData path (which takes priority when transformedData exists) relies on BarChartTransformer, which only checks mark.stack.
Steps to Reproduce
- Create a folder with notes that have a frontmatter property (e.g.,
Assignee)
- Create a bar chart visualization with:
- X field:
Assignee
- Y field:
File with count aggregate
- Color field:
Priority (or any other property)
- Toggle Stacked to On
- Observe bars are still side-by-side (grouped), not stacked
Expected Behavior
Bars should stack on top of each other, segmented by the color field.
Suggested Fix
In BarChartTransformer.ts line 140, also check the top-level stacked property:
const isStacked = config.mark?.stack === true || config.stacked === true;
Environment
- make.md version: 1.3.5
- Obsidian: latest
- OS: macOS
Bug Description
The Stacked toggle on bar charts (the layers icon in the chart context menu) has no effect. Bars always render side-by-side (grouped) regardless of the stacked setting.
Root Cause
In
src/core/react/components/Visualization/transformers/BarChartTransformer.ts, line 140:This checks
config.mark.stack, but the UI toggle and the config parser (vizConfigFromProps) set the top-levelconfig.stackedproperty — neverconfig.mark.stack. SoisStackedis alwaysfalse.The type definitions in
src/shared/types/visualization.tsconfirm both properties exist:mark.stack?: boolean(line 51) — never set by the UIstacked?: boolean(line 187) — set by the UI toggleThe legacy
renderLegacypath inD3VisualizationEngine.tsxcorrectly checks the top-levelstackedproperty, but the newerrenderWithTransformedDatapath (which takes priority whentransformedDataexists) relies onBarChartTransformer, which only checksmark.stack.Steps to Reproduce
Assignee)AssigneeFilewith count aggregatePriority(or any other property)Expected Behavior
Bars should stack on top of each other, segmented by the color field.
Suggested Fix
In
BarChartTransformer.tsline 140, also check the top-levelstackedproperty:Environment