Skip to content
Component

Chart

Lightweight, responsive SVG charts for dashboards and data summaries. Use the chart family for trends, comparisons, and composition without adding a charting dependency.

Line chart

A highlighted trend with a second semantic series. Move the pointer across the plot: a crosshair snaps to the nearest point and a tooltip shows its value.

Weekly signups

New accounts over the last seven days

926946230MonTueWedThuFriSatSun
SignupsPrevious week
Weekly signups
Signups, Mon42
Signups, Tue68
Signups, Wed54
Signups, Thu86
Signups, Fri73
Signups, Sat92
Signups, Sun78
Previous week, Mon42
Previous week, Tue60
Previous week, Wed38
Previous week, Thu86
Previous week, Fri65
Previous week, Sat76
Previous week, Sun78

Animated update

Series transition to their new shape when the data changes. Press the button to re-roll the values and watch the line and its area fill move.

Weekly signups

New accounts over the last seven days

926946230MonTueWedThuFriSatSun
Signups
Weekly signups
Signups, Mon42
Signups, Tue68
Signups, Wed54
Signups, Thu86
Signups, Fri73
Signups, Sat92
Signups, Sun78

Area fill

area draws a soft gradient under each line; curve defaults to a monotone 'smooth' cubic that never overshoots the data. strokeWidth sets the line weight.

Revenue

Weekly revenue with an area fill

926946230MonTueWedThuFriSatSun
Revenue
Revenue, Mon42
Revenue, Tue68
Revenue, Wed54
Revenue, Thu86
Revenue, Fri73
Revenue, Sat92
Revenue, Sun78
  • curve='linear' joins the points with straight segments - the honest choice for step data or sparse samples, where a curve would imply values between them

Bar chart

Use bars for compact comparisons between categories or periods.

New customers

926946230MonTueWedThuFriSatSun
New customers
Customers, Mon42
Customers, Tue68
Customers, Wed54
Customers, Thu86
Customers, Fri73
Customers, Sat92
Customers, Sun78

Dashboard card: highlight, average, and headline

highlight mutes every other bar and tags the emphasised one with its value and a pilled axis label; average draws a dotted reference line. icon, headline, and stats give the chart a dashboard-card header, and formatValue formats every printed figure.

Revenue

This week

$493kUp12%vs last week

Best day
Sat
Daily average
$70k
$92k$69k$46k$23k$0kMonTueWedThuFriSatSun$92kAvg $70k
Revenue
Revenue, Mon$42k
Revenue, Tue$68k
Revenue, Wed$54k
Revenue, Thu$86k
Revenue, Fri$73k
Revenue, Sat$92k
Revenue, Sun$78k
  • headline.value and stats values are strings you format yourself; formatValue covers the axis, the tooltips, the value tag and the screen-reader table
  • highlight also accepts an array of labels; deltaTrend='down' turns the headline pill red
  • Every chart takes the same header props - LineChart and DonutChart included

Donut chart

A composition summary with a center total. Hover a segment to thicken it and see its value and share; the list beside the ring is the legend, with each share as a percentage.

Team distribution

128Total
Design4233%Engineering5644%Operations3023%
Team distribution
Values, Design42
Values, Engineering56
Values, Operations30
  • The ring draws in clockwise on mount, and its segments and figures travel to new data

Formatted figures and center label

formatValue formats the legend, the tooltip and the default center total. centerLabel replaces the center figure, for a compact form of a long total.

Quarterly budget

$89kTotal
Payroll$48,20054%Marketing$21,90025%Hosting$12,60014%Travel$6,3007%
Quarterly budget
Values, Payroll$48,200
Values, Marketing$21,900
Values, Hosting$12,600
Values, Travel$6,300
  • The center fits about five characters before it truncates, which is what centerLabel is for
  • centerLabel is a fixed string, so unlike the default total it does not count between data sets
  • Pin a locale in formatValue for server-rendered pages - the default toLocaleString() can format differently on the server and in the browser

Loading and empty states

Loading

Loading

Empty

No chart data available.
Empty

Charts use theme tokens, remain responsive inside narrow cards, and include a screen-reader table alternative. A line or bar plot is a single tab stop: the arrow keys move a cursor along a series and between series, and Escape releases it.

API reference

series *None
ChartSeries[]

One entry per line. Changing the values animates the plot to its new shape.

actionsNone
React.ReactNode

Controls on the trailing edge of the header - typically ghost `IconButton`s.

areafalse
boolean

Fills under each line with a soft fade of its own color. Off by default: stacked translucent fills read as mud beyond one or two series.

curve"smooth"
"smooth" | "linear"

`"smooth"` (default) draws a monotone cubic curve through the points. `"linear"` uses straight segments - the honest choice when intermediate values must not be implied (step, sparse data).

descriptionNone
string

A line under the title saying what the figures are.

emptyNone
boolean

Forces the "no data" message even when `series` has content.

formatValueNone
((value: number) => string)

Formats every printed figure (ticks, tooltips, data table); omitted, `toLocaleString` in `locale`. Use it for currency, units or precision. Must return the same string on server and client.

headlineNone
ChartHeadline

The dashboard-card figure under the title: a big number with a change pill.

iconNone
React.ReactNode

A small glyph before the title.

legendNone
boolean

Lists the series names with their colour swatches under the plot.

loadingNone
boolean

Shows pulsing placeholder bars instead of the plot, for an async load.

localeDEFAULT_LOCALE
string

BCP 47 locale for default formatting. Default `"en-US"`: fixed, so server and client can't print "1,234" vs "1.234" and fail hydration. Pass the user's locale; ignored with `formatValue`.

showPointstrue
boolean

Draws a marker at every data point.

statsNone
ChartStat[]

A row of label/value pairs under the title ("Visit duration · 1m 35s").

strokeWidth3.5
number

Stroke width in viewBox units. Default 3.5.

titleNone
string

Heading above the plot. Also becomes the plot's accessible name and its data table's caption.

Also accepts everything from ChartBaseProps.

BarChart props

series *None
ChartSeries[]

One entry per bar group. Changing the values animates the bars to their new heights.

actionsNone
React.ReactNode

Controls on the trailing edge of the header - typically ghost `IconButton`s.

averageNone
number

Draws a dotted reference line at this value with a small tag - an average, target, budget.

averageLabel"Avg"
string

Names the `average` line's tag. Default "Avg".

descriptionNone
string

A line under the title saying what the figures are.

emptyNone
boolean

Forces the "no data" message even when `series` has content.

formatValueNone
((value: number) => string)

Formats every printed figure (ticks, tooltips, data table); omitted, `toLocaleString` in `locale`. Use it for currency, units or precision. Must return the same string on server and client.

headlineNone
ChartHeadline

The dashboard-card figure under the title: a big number with a change pill.

highlightNone
string | string[]

Labels of the bars to emphasise: they keep their series colour, get a value tag and a pilled x-axis label, and every other bar is muted. Omit to colour every bar.

iconNone
React.ReactNode

A small glyph before the title.

legendNone
boolean

Lists the series names with their colour swatches under the plot.

loadingNone
boolean

Shows pulsing placeholder bars instead of the plot, for an async load.

localeDEFAULT_LOCALE
string

BCP 47 locale for default formatting. Default `"en-US"`: fixed, so server and client can't print "1,234" vs "1.234" and fail hydration. Pass the user's locale; ignored with `formatValue`.

statsNone
ChartStat[]

A row of label/value pairs under the title ("Visit duration · 1m 35s").

titleNone
string

Heading above the plot. Also becomes the plot's accessible name and its data table's caption.

Also accepts everything from ChartBaseProps.

DonutChart props

data *None
ChartPoint[]

The slices. Changing the values animates the ring and its figures.

actionsNone
React.ReactNode

Controls on the trailing edge of the header - typically ghost `IconButton`s.

centerLabelNone
string

Overrides the figure in the ring's hole. Defaults to the formatted total.

descriptionNone
string

A line under the title saying what the figures are.

emptyNone
boolean

Forces the "no data" message even when `series` has content.

formatValueNone
((value: number) => string)

Formats every printed figure (ticks, tooltips, data table); omitted, `toLocaleString` in `locale`. Use it for currency, units or precision. Must return the same string on server and client.

headlineNone
ChartHeadline

The dashboard-card figure under the title: a big number with a change pill.

iconNone
React.ReactNode

A small glyph before the title.

legendNone
boolean

Lists the series names with their colour swatches under the plot.

loadingNone
boolean

Shows pulsing placeholder bars instead of the plot, for an async load.

localeDEFAULT_LOCALE
string

BCP 47 locale for default formatting. Default `"en-US"`: fixed, so server and client can't print "1,234" vs "1.234" and fail hydration. Pass the user's locale; ignored with `formatValue`.

statsNone
ChartStat[]

A row of label/value pairs under the title ("Visit duration · 1m 35s").

titleNone
string

Heading above the plot. Also becomes the plot's accessible name and its data table's caption.

Also accepts everything from ChartBaseProps.

Coding agents read this reference, with its examples, from the version your project has installed, through the Fuji UI MCP server. Set up your agent