ValyroUI English version

Line Chart

Линейные графики. Бесплатно, MIT · Графики и аналитика › Динамика

Установка

npx valyro-cli@latest add line-chart
npx shadcn@latest add https://valyro.xyz/r/line-chart.json
npm install valyro-ui

import 'valyro-ui/styles.css';
import { LineChart } from 'valyro-ui';

Пропсы

PropTypeDefault
data *T[]Rows to plot, one per x position; a missing or non-numeric value breaks that series' line.
x *XField used for the x axis (dates or categories), plotted in data order.
series *ChartSeries<T>[]Numeric fields drawn as lines (or areas), each with its legend label and optional color.
heightnumberPlot height in px; width follows the container. Default 240.
curve'linear' | 'monotone'Default: the theme's --ui-chart-curve (linear in Vercel, monotone in Glass).
valueFormatterValueFormatterFormats values in the tooltip and data table. Axis ticks keep its units around a shorter number ("$15K").
tickFormatterValueFormatterFormats the value-axis ticks instead of the shortened valueFormatter.
xFormatter(value: T[X], index: number) => stringFormats x values for axis labels and the tooltip title.
localestringBCP 47 locale for the default number and date formatting. Default: the ThemeProvider locale, then the browser's.
xLabelstringHeader of the x column in the accessible data table. Default: the x key.
labelsPartial<XYChartLabels>Overrides for the built-in strings.
showGridbooleanHorizontal grid lines at the value ticks; the zero line is drawn either way.
showLegendbooleanDefault: shown when there is more than one series.
loadingbooleanShows a placeholder of the same height while data loads.
ariaLabel *stringAccessible name of the chart (also the caption of its sr-only data table).

Похожие компоненты

  • Bar Chart — Столбчатые диаграммы
  • Area Chart — Графики с заливкой
  • Scatter Chart — Точечные и пузырьковые диаграммы с линией тренда
  • Sparkline — Мини-графики
  • Confidence Band Chart — Прогноз с доверительными интервалами и выбросами, точки читаются с клавиатуры
  • Candlestick Chart — Биржевые свечи с объёмами и скользящими средними
  • Donut Chart — Кольцевые диаграммы
  • Treemap — Иерархии площадями с переходом по уровням
  • Funnel Chart — Воронки конверсии
  • Sankey Chart — Диаграммы потоков между этапами
  • Radar Chart — Лепестковые диаграммы для сравнения профилей
  • Heatmap — Тепловые карты

Назад: Leaderboard · Далее: Bar Chart · Весь раздел «Графики и аналитика»