Chart Line

Time-series line charts built on unovis-vue. Pass an array of rows plus a config that maps each series key to a label and color.

Default

A single-series line with a natural curve, gradient-free.

Dark previewReplay previewOpen in new tab

Usage

Import the parts you need from the component's folder.

ts
import {
  ChartLineDefault,
  ChartLine,
  ChartLineLinear,
  ChartLineStep,
  ChartLineInteractive,
} from "@/components/ui/chart";

Comparison

ChartLine overlays a dashed previous-period line and a gradient area fill for at-a-glance trends.

Dark previewReplay previewOpen in new tab

Linear

Straight segments between points (CurveType.Linear).

Dark previewReplay previewOpen in new tab

Step

Stepped interpolation (CurveType.Step).

Dark previewReplay previewOpen in new tab

Interactive

Toggle between series; totals update in the header.

Dark previewReplay previewOpen in new tab

API Reference

ChartLineDefault

PropTypeDefaultDescription
dataRecord<string, any>[]—Series rows.
configChartConfig—Map of dataKey → { label, color }.
dataKeystring"value"Row key for the y value.
xKeystring"date"Row key for the x value.

ChartLine

PropTypeDefaultDescription
dataRecord<string, any>[]—Series rows (each with a date key).
configChartConfig—Theming map.
dataKeystring"value"Row key for the y value.
gradientbooleanfalseRender a gradient area fill under the line.
comparisonDataRecord<string, any>[][]Previous-period rows overlaid as a dashed line.
comparisonLabelstring"Previous Period"Legend/tooltip label for the comparison series.
yTickFormatter(d) => stringnullCustom y-axis tick formatter.

ChartLineLinear / ChartLineStep

PropTypeDefaultDescription
dataRecord<string, any>[]—Series rows.
configChartConfig—Theming map.
dataKeystring"value"Row key for the y value.
xKeystring"date"Row key for the x value.

ChartLineInteractive

PropTypeDefaultDescription
dataRecord<string, any>[]—Series rows.
configChartConfig—Theming map; series with a color become toggles.
dataKeysstring[]nullOverride which series are selectable.
xKeystring"date"Row key for the x value.
titlestring""Optional header title.
descriptionstring""Optional header description.