Charts plus JS behaviour

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

Visits by channel
SearchDirectSocialEmailTotal
Apr 4228128 90
May 4627159 97
Jun 5130199 109
Jul 49332610 118
Aug 55313112 129
Sep 61342811 134
Oct 66362513 140
Nov 64392914 146
Dec 70383413 155
Jan 74413815 168
Feb 79433617 175
Mar 86444118 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

Channel mix
SearchDirectSocialEmailTotal
Apr 4228128 90
May 4627159 97
Jun 5130199 109
Jul 49332610 118
Aug 55313112 129
Sep 61342811 134
Oct 66362513 140
Nov 64392914 146
Dec 70383413 155
Jan 74413815 168
Feb 79433617 175
Mar 86444118 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

Requests per hour
Middle EastEuropeAsiaTotal
00 3.22.44.1 9.7
03 2.11.64.8 8.5
06 2.81.85.6 10.2
09 6.43.95.1 15.4
12 8.15.63.4 17.1
15 7.66.12.6 16.3
18 9.25.22.9 17.3
21 6.83.83.6 14.2

Important props

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 />