Stacked bar
Stacked, percent or grouped bars, vertical or horizontal (horizontal ones grow from the right in RTL). Only the top segment is rounded, totals sit on each stack and the legend adds or removes series with a tween.
Real scenarios
The component as it is used in a product — not a specimen grid.
Orders by status this week
Each day is one column: delivered at the base, then in transit, then returned. Only the top segment is rounded, a 1px surface seam separates the rest, and totals sits each day’s sum on its stack. Columns grow in on a spring, one after another; switch a status off and the stacks retween.
1,863 orders · 67 returned
Ticket outcome by team, 100%
Horizontal percent bars compare teams of very different sizes. On a Persian page the bars grow from the right and the names sit in the right gutter; arrow keys (up/down too) walk the teams.
Signups by plan, grouped
mode="grouped" sets the plans side by side within each quarter, every bar rounded at its data end. Gradient fills deepen toward the value.
Important props
| Prop | Type | Default | What it does |
|---|---|---|---|
| labels / series | array | [] | Categories and series, like the other charts. |
| mode | string | stacked | stacked · percent (each bar = 100%) · grouped (side by side). |
| orientation | string | vertical | vertical | horizontal — horizontal puts the names in a gutter and mirrors with the page direction. |
| fill / totals | string / bool | solid / false | The fill (solid | gradient | hatched | duotone) and a total label on each stack. |
| hidden-series / height | array / int | [] / auto | Series off at start, and the height (horizontal: grows with the categories). |
Snippet
<x-nx::stacked-bar title="تیکتها به تفکیک تیم" orientation="horizontal" mode="percent" totals
:labels="$teams" :series="[
['name' => 'حلشده', 'values' => $solved],
['name' => 'در انتظار', 'values' => $pending],
['name' => 'ارجاعشده', 'values' => $escalated],
]" />