Line Chart

カテゴリーまたは時間軸上の 1 つ以上の系列。直線または滑らかな線、切りのよい目盛りの値軸、点、凡例、ツールチップを備え、ロービングフォーカスと非表示のデータテーブルに対応します。

対応フレームワーク
  • Angular: 対応
  • Vue: 対応
  • React: 対応
  • React Native: 対応

使い方

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

インポート

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

API リファレンス

SoneLineChartComponentコンポーネント

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

セレクター
sone-line-chart
入力
名前型 デフォルト
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`