Charts
Line Chart
Up to four smooth lines you can read point by point with the pointer, touch, or arrow keys. New data morphs the lines instead of redrawing them.
src/components/charts/line-chart.tsxNo ui-sdk
Comparison and a metric switch
| Label | Tahun ini | Tahun lalu |
|---|---|---|
| Jan | 180 | 140 |
| Feb | 210 | 152 |
| Mar | 196 | 150 |
| Apr | 260 | 171 |
| Mei | 248 | 180 |
| Jun | 301 | 176 |
| Jul | 322 | 198 |
| Agu | 310 | 205 |
| Sep | 355 | 210 |
| Okt | 390 | 232 |
| Nov | 372 | 240 |
| Des | 428 | 251 |
Geser kursor, sentuh, atau fokus lalu tekan panah untuk membaca setiap bulan.
Three apps
| Label | Kasir | Pasien | Armada |
|---|---|---|---|
| M1 | 420 | 300 | 120 |
| M2 | 480 | 320 | 150 |
| M3 | 510 | 360 | 170 |
| M4 | 560 | 350 | 210 |
| M5 | 590 | 400 | 220 |
| M6 | 650 | 430 | 260 |
| M7 | 700 | 420 | 290 |
| M8 | 740 | 470 | 300 |
| M9 | 810 | 500 | 340 |
| M10 | 880 | 520 | 360 |
Import
tsx
import { LineChart } from "@/components/charts/line-chart";Guidelines
- Labels at the end of each line replace a legend.
- Use
dashedfor a previous period or a target, andareato bring the first line forward. - Swap in data with the same number of points so the lines morph smoothly.
- The chart is an invisible native slider: Tab to focus, arrows to move between points, and each point is announced.