Chart is a namespace, not a component you can render. Import it as Chart and use one of its
members: Chart.Bar, Chart.Line, Chart.Pie, Chart.Metric, Chart.Funnel, or Chart.Loading.
Which chart to use
Pick by the question the chart answers, not by the data you happen to have.Chart.Metric
One number, rendered large. A total, a count, a rate. Nothing to compare it against, so
nothing is plotted.
Chart.Bar
Compare values across categories. Several series per category, side by side
(
mode="grouped") or as one stack (mode="stacked").Chart.Line
Follow a value along an ordered axis, usually dates. Use it when the shape of the trend
matters more than each individual value.
Chart.Pie
Parts of one whole, a handful of slices. Slices always draw largest first, so use it for
composition, never for ranking over time.
Chart.Funnel
Ordered stages, each measured against the one before. Conversion through a pipeline, not
composition of a total.
Chart.Loading
A placeholder while data is in flight. Give it the height of the chart it stands in for.
At a glance
Shared props
These apply to every chart exceptChart.Loading, which only takes height.
title
An optional caption above the chart.
height
The token covers the whole chart: a title and a legend fit inside it rather than adding to it.
Defaults to "medium".
Height tokens do not shrink. If the surface is shorter than the token, the surface scrolls rather
than squeezing the chart to a blank box.
Color tokens
Names rather than hex values, so charts follow the viewer’s theme:"blue" "green" "yellow" "orange" "red" "purple" "pink" "teal" "grey"
On a cartesian chart, set color on series, not on each point. On a pie or funnel, set color on
each slice or step. A metric takes color on the component. The default is the report palette slot,
except metric and funnel steps, which default to "blue".
format
How a value is rendered, in the viewer’s locale. These examples are from the en-US tests against
the shipped formatter.
States
Chart.Loadingis the placeholder while data is in flight. Give it the sameheightas the chart it stands in for so the dialog does not reflow.- An empty
dataarray (and a funnel whose first step is0) draws No data instead of a plot. - If the host cannot draw the chart, the error boundary draws Something went wrong and keeps the resolved height.