Line Chart

Una o varias series sobre categorías o tiempo: líneas rectas o suavizadas, un eje de valores con marcas redondas, puntos, leyenda y tooltip, con foco itinerante y una tabla de datos oculta.

Disponible en
  • Angular: disponible
  • Vue: disponible
  • React: disponible
  • React Native: disponible

Uso

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

Importación

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

Referencia de la API

SoneLineChartComponentComponente

`<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.

Selector
sone-line-chart
Inputs
NombreTipo Predeterminado
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`