Brush chart
A line / area chart with a range brush under it: drag the window to pan, drag the edges to resize (native range inputs, full keyboard); the main plot zooms to the range and dispatches nx-range.
Real scenarios
The component as it is used in a product — not a specimen grid.
Daily active users, last 90 days
The strip under the chart holds all 90 days; the window picks the slice the main plot zooms to. Drag the window to pan, drag either edge to resize — the edges are native range inputs, so Tab lands on them and the arrow keys work as everywhere. With the window focused, arrows pan by a day and Shift+arrow by a whole window. The launch week spike is marked as the range’s high.
Daily active users
Web + app
Selected range
| Active users | |
|---|---|
| Day 1 | 3,864 |
| Day 2 | 4,238 |
| Day 3 | 4,533 |
| Day 4 | 4,659 |
| Day 5 | 4,526 |
| Day 6 | 3,775 |
| Day 7 | 3,454 |
| Day 8 | 4,109 |
| Day 9 | 4,504 |
| Day 10 | 4,815 |
| Day 11 | 4,946 |
| Day 12 | 4,803 |
| Day 13 | 4,004 |
| Day 14 | 3,661 |
| Day 15 | 4,353 |
| Day 16 | 4,770 |
| Day 17 | 5,096 |
| Day 18 | 5,234 |
| Day 19 | 5,079 |
| Day 20 | 4,233 |
| Day 21 | 3,869 |
| Day 22 | 4,598 |
| Day 23 | 5,036 |
| Day 24 | 5,378 |
| Day 25 | 5,521 |
| Day 26 | 5,356 |
| Day 27 | 4,462 |
| Day 28 | 4,076 |
| Day 29 | 4,843 |
| Day 30 | 5,302 |
| Day 31 | 5,660 |
| Day 32 | 5,808 |
| Day 33 | 5,633 |
| Day 34 | 4,690 |
| Day 35 | 4,284 |
| Day 36 | 5,088 |
| Day 37 | 5,568 |
| Day 38 | 5,942 |
| Day 39 | 6,096 |
| Day 40 | 5,909 |
| Day 41 | 4,919 |
| Day 42 | 4,491 |
| Day 43 | 5,332 |
| Day 44 | 5,834 |
| Day 45 | 6,224 |
| Day 46 | 6,383 |
| Day 47 | 6,186 |
| Day 48 | 5,148 |
| Day 49 | 4,699 |
| Day 50 | 5,577 |
| Day 51 | 6,100 |
| Day 52 | 6,506 |
| Day 53 | 6,670 |
| Day 54 | 6,463 |
| Day 55 | 5,377 |
| Day 56 | 4,906 |
| Day 57 | 5,822 |
| Day 58 | 6,366 |
| Day 59 | 6,788 |
| Day 60 | 6,957 |
| Day 61 | 6,739 |
| Day 62 | 7,175 |
| Day 63 | 6,903 |
| Day 64 | 8,614 |
| Day 65 | 8,953 |
| Day 66 | 9,050 |
| Day 67 | 8,766 |
| Day 68 | 7,016 |
| Day 69 | 5,834 |
| Day 70 | 5,321 |
| Day 71 | 6,311 |
| Day 72 | 6,898 |
| Day 73 | 7,352 |
| Day 74 | 7,532 |
| Day 75 | 7,292 |
| Day 76 | 6,063 |
| Day 77 | 5,529 |
| Day 78 | 6,556 |
| Day 79 | 7,164 |
| Day 80 | 7,634 |
| Day 81 | 7,819 |
| Day 82 | 7,569 |
| Day 83 | 6,292 |
| Day 84 | 5,736 |
| Day 85 | 6,801 |
| Day 86 | 7,430 |
| Day 87 | 7,916 |
| Day 88 | 8,106 |
| Day 89 | 7,846 |
| Day 90 | 6,521 |
Two days of CPU, a narrow window
variant="line" without the wash, and a six-hour window. Every move dispatches nx-range with { range, from, to } — the readout below listens to it with plain Alpine.
CPU usage
Percent · app-server-2
Selected range
| CPU | |
|---|---|
| 00:00 | 15 |
| 01:00 | 15 |
| 02:00 | 16 |
| 03:00 | 19 |
| 04:00 | 23 |
| 05:00 | 18 |
| 06:00 | 25 |
| 07:00 | 32 |
| 08:00 | 40 |
| 09:00 | 48 |
| 10:00 | 45 |
| 11:00 | 52 |
| 12:00 | 57 |
| 13:00 | 61 |
| 14:00 | 64 |
| 15:00 | 55 |
| 16:00 | 55 |
| 17:00 | 54 |
| 18:00 | 51 |
| 19:00 | 48 |
| 20:00 | 34 |
| 21:00 | 30 |
| 22:00 | 27 |
| 23:00 | 24 |
| 00:00 | 23 |
| 01:00 | 13 |
| 02:00 | 14 |
| 03:00 | 17 |
| 04:00 | 21 |
| 05:00 | 26 |
| 06:00 | 23 |
| 07:00 | 30 |
| 08:00 | 38 |
| 09:00 | 46 |
| 10:00 | 53 |
| 11:00 | 50 |
| 12:00 | 55 |
| 13:00 | 59 |
| 14:00 | 62 |
| 15:00 | 63 |
| 16:00 | 53 |
| 17:00 | 52 |
| 18:00 | 49 |
| 19:00 | 46 |
| 20:00 | 42 |
| 21:00 | 28 |
| 22:00 | 25 |
| 23:00 | 22 |
Last event: →
Important props
| Prop | Type | Default | What it does |
|---|---|---|---|
| labels / series | array | [] | All the data; the main plot shows only the selected range. |
| range / min-span | array / int | last third / 2 | The starting [start, end] index range and the narrowest window. |
| variant / curve | string | area / smooth | area | line, and the curve smooth | linear | step. |
| x-on:nx-range | event | — | Every change: detail = { range, from, to } — e.g. $wire.set('range', $event.detail.range). |
| height / brush-height / markers | int / int / bool | 240 / 56 / true | The main plot and strip heights, and high / low markers of the range. |
Snippet
<x-nx::brush-chart title="کاربران فعال روزانه" :labels="$days"
:series="[['name' => 'کاربر فعال', 'values' => $dau]]"
:range="[60, 89]" min-span="6"
x-on:nx-range="$wire.set('range', $event.detail.range)" />