Line Chart

Jedna lub kilka serii w kategoriach albo w czasie: proste lub wygładzone linie, oś wartości z okrągłymi podziałkami, punkty, legenda i podpowiedź, z ruchomym fokusem i ukrytą tabelą danych.

Dostępny w
  • Angular: dostępny
  • Vue: dostępny
  • React: dostępny
  • React Native: dostępny

Użycie

  • Desktop
  • Mobile
Visitors, January to June 2026
MonthDesktopMobile
Jan18680
Feb305200
Mar237120
Apr73190
May209130
Jun214140

Import

ts
import {
  SoneLineChartComponent,
} from "@surface-one/angular/line-chart";

Dokumentacja API

SoneLineChartComponentKomponent

`<sone-line-chart>` — one or more series over categories or time (shadcn/ui Line Chart): a value axis with round ticks and grid lines, straight or smoothed (`curve="smooth"`, monotone) lines that break at a missing value, dots, a legend and a tooltip. `area` fills under the lines and `stacked` stacks them (what `<sone-area-chart>` draws). One Tab stop with a roving focus over the x values (Left/Right/Home/End, Escape hides the tooltip); each is an image named by its values, and a visually hidden table carries the data for screen-reader browsing.

Selektor
sone-line-chart
Wejścia
NazwaTyp Domyślnie
data

The rows, left to right: each holds the x value (`xKey`) and one value per series.

readonly T[][]
series

The series: `{ key, label, tone }`, `key` naming the row property of its values.

readonly SoneLineChartSeries[][]
xKey

The row property of the x value.

string"x"
xScale

`category` — evenly spaced; `time` — spaced by date (`Date`, epoch ms or ISO string).

SoneLineChartXScale"category"
xFormat

The label of an x value (axis, tooltip, table); default: the text, or a short date.

SoneLineChartXFormat | nullnull
xTicks

At most this many x-axis labels (stepped back from the last one); 0 hides the axis.

number6
yTicks

About this many value-axis steps.

number4
yMin

The bottom of the value axis; default: 0, or the lowest value when negative.

number | nullnull
yMax

The top of the value axis; default: a round step above the highest value.

number | nullnull
height

The plot height in CSS pixels (the x labels sit below it).

number200
curve

`linear` — straight segments; `smooth` — a monotone curve.

SoneLineChartCurve"linear"
area

Fills under each line.

booleanfalse
stacked

Stacks the series on one another (with `area`, each fills down to the one below).

booleanfalse
dots

Draws a dot on every value (the hovered or focused x value always shows its dots).

booleantrue
legend

Shows the legend under the plot.

booleantrue
ariaLabel

Names the chart and captions its data table (“Visitors, January to June”).

string""
valueFormat

Formats values on the axis, in the tooltip and in the data table.

SoneLineChartFormatdefaultFormat
categoryHeader

The data table's category column header.

—$localize`Category`