stack key. The variables are the series, so variant assigns color per series index. Use monochrome for four or fewer series, and categorical for five or more.
- Design rules: Bar charts — stacked
- Shared API / tooltips / palettes: Chart component
- Plain bar / direct labels: Bar
Minimal option
The option matches a grouped bar chart, withstack set on every series in the stack. Set stack in the option, since stacking carries meaning. variant supplies the rest of the treatment.
Variant styling
variant applies the following treatment:
Segment gaps apply only on the
variant path, where the theme fills the stack. Composing with chartPalette and chartStepItemStyle, as a semantic palette does, leaves the segments touching. Separate them another way: borders on outlined steps usually suffice, and otherwise leave space in the data or layout. See Chart component and Palettes.
Tooltips
PassrenderTooltip to add hover content. See Chart component.