Charts plus JS behaviour

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.

Orders

This week · all warehouses

Orders
DeliveredIn transitReturned Total
Sat 182449 235
Sun 164527 223
Mon 1984712 257
Tue 211588 277
Wed 2366111 308
Thu 2747214 360
Fri 158396 203

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.

Ticket outcomes

Ticket outcomes
SolvedWaitingEscalated Total
Sales 4126112 485
Technical 2869448 428
Billing 158229 189
Accounts 121185 144
Orders 3444721 412

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.

New subscriptions

By quarter

New subscriptions
StarterGrowthBusiness
Q1 32014036
Q2 41019048
Q3 38023061
Q4 46026072

Important props

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],
    ]" />