Chart Area

Area charts built on unovis-vue. One ChartArea handles single or multi-series data, with optional gradient fills and stacking.

Default

A single-series gradient area.

Dark previewReplay previewOpen in new tab

Usage

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

ts
import { ChartArea, ChartAreaInteractive } from "@/components/ui/chart";

Gradient

Multiple overlapping series, each with its own gradient fill.

Dark previewReplay previewOpen in new tab

Stacked

Series stacked on top of each other (stacked prop).

Dark previewReplay previewOpen in new tab

Axes

Solid multi-series fills with both axes labelled.

Dark previewReplay previewOpen in new tab

Legend & icons

Add a legend and per-series icons via the config.

Dark previewReplay previewOpen in new tab

Interactive

Filter the visible range with a select.

Dark previewReplay previewOpen in new tab

Gradient with grid

A gradient area over a dashed horizontal grid.

Dark previewReplay previewOpen in new tab

Stacked with dashed strokes

Stacked gradient areas with per-series dashed outlines.

Dark previewReplay previewOpen in new tab

Step with dotted fill

A step curve filled with a dotted SVG pattern.

Dark previewReplay previewOpen in new tab

Glowing dots

A glowing line and dot markers via SVG filters.

Dark previewReplay previewOpen in new tab

Crosshatch pattern

Stacked areas filled with crosshatch SVG patterns.

Dark previewReplay previewOpen in new tab

API Reference

ChartArea

PropTypeDefaultDescription
dataRecord<string, any>[]—Series rows.
configChartConfig—Map of key → { label, color, icon }.
dataKeystring"value"Single-series row key.
dataKeysstring[]nullMulti-series row keys (overrides dataKey).
xKeystring"date"Row key for the x value.
gradientbooleanfalseFill areas with a gradient instead of a solid color.
stackedbooleanfalseStack multi-series areas.
legendbooleanfalseRender a legend below the chart.
numXTicksnumber6Approximate x-axis tick count.
curveTypestring"natural"Curve interpolation (natural, linear, step, stepAfter, ...).
svgDefsstringnullRaw SVG <defs> string; overrides the auto gradient when set.
areaFillstring | Record<string, string>nullOverride the area fill; string or per-key map (url(#pattern)).
fillOpacitynumbernullFill opacity (defaults adapt to gradient/stacked).
gridbooleanfalseDraw horizontal dashed grid lines.
dashedKeysstring[][]Series keys whose line is rendered dashed.
strokeWidthByKeyRecord<string, number>nullPer-series line width.
lineFilterstringnullSVG filter url applied to the line/area (e.g. a glow).
dotsbooleanfalseRender point markers at each datum.
dotFilterstringnullSVG filter url applied to the dots.
hideYAxisbooleanfalseHide the y axis.
xTickFormatter(d) => stringnullCustom x-axis tick formatter.
yTickFormatter(d) => stringnullCustom y-axis tick formatter.

ChartAreaInteractive

PropTypeDefaultDescription
dataRecord<string, any>[]—Series rows (with a date key).
configChartConfig—Theming map.
dataKeysstring[]nullSeries to plot (defaults to coloured config keys).
xKeystring"date"Row key for the x value.
titlestring""Optional header title.
descriptionstring""Optional header description.