Stacked area
Layers piled up — absolute, percent (100%) or a stream centred on zero; smooth, linear or step curves; gradient, solid, hatched or duotone fills. Legend buttons switch series on and off and the stack re-piles with a tween.
Real scenarios
The component as it is used in a product — not a specimen grid.
Traffic by channel, piled up
Four channels stacked from zero, so the top edge is the whole site. Switch a channel off in the legend — the stack re-piles with a tween and the axis rescales under it. The ping sits on the latest value; the markers name the busiest and the quietest month.
Visits by channel
Thousands · last 12 months
| Search | Direct | Social | Total | ||
|---|---|---|---|---|---|
| Apr | 42 | 28 | 12 | 8 | 90 |
| May | 46 | 27 | 15 | 9 | 97 |
| Jun | 51 | 30 | 19 | 9 | 109 |
| Jul | 49 | 33 | 26 | 10 | 118 |
| Aug | 55 | 31 | 31 | 12 | 129 |
| Sep | 61 | 34 | 28 | 11 | 134 |
| Oct | 66 | 36 | 25 | 13 | 140 |
| Nov | 64 | 39 | 29 | 14 | 146 |
| Dec | 70 | 38 | 34 | 13 | 155 |
| Jan | 74 | 41 | 38 | 15 | 168 |
| Feb | 79 | 43 | 36 | 17 | 175 |
| Mar | 86 | 44 | 41 | 18 | 189 |
Year total: 1,650 thousand visits
The same year as shares
mode="percent" normalises every month to 100%, so the mix reads at a glance: social keeps eating into direct. The tooltip shows each share and the raw number behind it. Duotone fills split each layer into two tones of its own colour.
Channel mix
Share of monthly visits
| Search | Direct | Social | Total | ||
|---|---|---|---|---|---|
| Apr | 42 | 28 | 12 | 8 | 90 |
| May | 46 | 27 | 15 | 9 | 97 |
| Jun | 51 | 30 | 19 | 9 | 109 |
| Jul | 49 | 33 | 26 | 10 | 118 |
| Aug | 55 | 31 | 31 | 12 | 129 |
| Sep | 61 | 34 | 28 | 11 | 134 |
| Oct | 66 | 36 | 25 | 13 | 140 |
| Nov | 64 | 39 | 29 | 14 | 146 |
| Dec | 70 | 38 | 34 | 13 | 155 |
| Jan | 74 | 41 | 38 | 15 | 168 |
| Feb | 79 | 43 | 36 | 17 | 175 |
| Mar | 86 | 44 | 41 | 18 | 189 |
Gateway load as a stream
mode="expanded" centres the pile on zero — a streamgraph whose silhouette breathes with the day. Step curves show the hourly buckets honestly, and hatched fills (an SVG pattern per series) keep the layers apart in print and in high contrast. Europe starts switched off.
Requests per hour
Millions · by region
| Middle East | Europe | Asia | Total | |
|---|---|---|---|---|
| 00 | 3.2 | 2.4 | 4.1 | 9.7 |
| 03 | 2.1 | 1.6 | 4.8 | 8.5 |
| 06 | 2.8 | 1.8 | 5.6 | 10.2 |
| 09 | 6.4 | 3.9 | 5.1 | 15.4 |
| 12 | 8.1 | 5.6 | 3.4 | 17.1 |
| 15 | 7.6 | 6.1 | 2.6 | 16.3 |
| 18 | 9.2 | 5.2 | 2.9 | 17.3 |
| 21 | 6.8 | 3.8 | 3.6 | 14.2 |
Important props
| Prop | Type | Default | What it does |
|---|---|---|---|
| labels / series | array | [] | The x labels and the series: [['name' => …, 'values' => […]], …]; negatives count as zero. |
| mode | string | stacked | stacked (absolute) · percent (each column = 100%) · expanded (a stream, symmetric around zero). |
| curve / fill | string | smooth / gradient | Curve: smooth | linear | step. Fill: gradient | solid | hatched | duotone (SVG patterns). |
| hidden-series | array | [] | Names of series that start switched off. |
| ping / markers | bool | true / false | A ping on the latest value; high / low markers on the column totals. |
| height / format / locale | int / array / string | 280 / null / app | Plot height, Intl.NumberFormat options and the digits’ locale. |
Snippet
<x-nx::stacked-area title="ترافیک به تفکیک کانال" :labels="$months" :series="[
['name' => 'جستوجو', 'values' => $search],
['name' => 'مستقیم', 'values' => $direct],
['name' => 'شبکههای اجتماعی', 'values' => $social],
]" mode="percent" fill="hatched" markers />