Examples
AreaChart — Default
AreaChart — With Legend
AreaChart — Stacked
AreaChart — Multi Series
AreaChart — Linear
BarChart — Default
BarChart — Negative Values
BarChart — With Legend
Props
ChartCard
Wraps any chart with a structured header containing title, subtitle, optional trend indicator, date range label, info tooltip, and a loading skeleton state. Athierarchy="primary" this implements the V2 Insight Card surface, which differs from Card’s own primary hierarchy: a white fill, the strong border, and a 12px radius.
Stretch the card to its container’s height (e.g. a grid row shared with a taller card) and let the chart content take the height left under the header. Content that needs to scroll in that space should do so itself.
Surface treatment.
primary follows the V2 Insight Card spec (white fill, strong border, 12px radius); secondary uses the Card secondary surface.Trend indicator config. Rendered as a coloured directional arrow and label beside the subtitle, so it is only shown when
subtitle is provided.ChartCenterLabel
Centered label for radial/pie charts, rendered inside a Recharts<Label>.
Recharts viewBox with center coordinates.
ChartContainer
Wraps a Recharts chart with responsive sizing, design-token theming, and accessible config context for tooltips and legends.Recharts chart element(s) to render inside the responsive container. Typically a single
<AreaChart>, <BarChart>, <LineChart>, etc.ChartGrid
The design-system grid for cartesian charts: faint solid horizontal lines (neutral-alphas-200 at 40%) and a stronger border-strong baseline at value 0. Render it as a direct child of a Recharts <LineChart>, <AreaChart> or <BarChart>, and leave <YAxis domain> at its default.
The baseline is a one-row grid placed by the y scale, not a visible ReferenceLine, because Recharts draws no ReferenceLine while data is empty (there is no x scale). The hidden ReferenceLine only keeps 0 inside the y domain when every value is negative.
Takes no props of its own beyond the standard attributes of the element it renders.
ChartLegend
Re-export of RechartsLegend — use with content={<ChartLegendContent />}.
A direct re-export of RechartsLegend from recharts, provided so a chart can be assembled from one import. Its props are recharts’s own — see the recharts documentation.
ChartLegendContent
Styled legend content for use with<ChartLegend content={<ChartLegendContent />} />.
Reads chart config from context to resolve labels and icons.
ChartLoadingOverlay
A positioned overlay shown on top of chart content while it loads. The children are always rendered to maintain layout dimensions. By default the overlay is opaque and shows a wave-animatedChartSkeleton shaped like the chart. At variant={false} it falls back to a semi-transparent wash with a centred spinner.
Accessible name for the loading region, announced while
loading is true. Pass a translated string for i18n. Only applies to the skeleton path; the variant={false} spinner carries its own label.Shape of the wave-animated
ChartSkeleton shown while loading. Set it to match the chart underneath — circular for pie/radial, bar for bar charts. Pass false to fall back to the legacy centred spinner.ChartMetricTrend
The small area chart inside a metric tile, per theV2 Area Chart Item slot of the Figma insight card.
series is optional because the endpoints behind these cards often return a single scalar with no history. With nothing to plot the chart draws a flat line at the current value rather than collapsing the slot, so the card keeps the height and shape the design gives it. The line is deliberately level rather than shaped, so it asserts no history that the data cannot support.
ChartPieLegend
A side legend for pie/donut charts that shows each slice’s label, formatted value, and a proportional progress bar.ChartSeriesToggle
Renders a wrapping row of toggleableChips that control which series are visible on a multi-series chart. Each chip sizes to its label, shows a series colour dot, and exposes its state through aria-pressed.
ChartSkeleton
A wave-animated placeholder shaped like the content it stands in for — a chart series, a ranked table, or a breakdown of labelled bars. Use it while data loads instead of a generic spinner, so the layout does not visibly shift once the real content renders. For a chart body, pass it toChartLoadingOverlay via its variant prop rather than rendering it directly. For a card body, pass it to ChartCard’s skeleton prop.
How many items to draw: rows for
table and rows, bars for bar. Match the count the loaded card will show, so the card does not resize once the real content arrives. Defaults to 5 rows, or 7 bars.ChartStyle
Injects a scoped<style> tag that maps each config entry to a --color-{key} CSS custom property, with light/dark theme support.
Rendered automatically by ChartContainer — you rarely need this directly.
ChartTooltip
Re-export of RechartsTooltip — use with content={<ChartTooltipContent />}.
A direct re-export of RechartsTooltip from recharts, provided so a chart can be assembled from one import. Its props are recharts’s own — see the recharts documentation.
ChartTooltipContent
Styled tooltip content for use with<ChartTooltip content={<ChartTooltipContent />} />.
Reads chart config from context to resolve labels, colors, and icons. Supports dot/line/dashed indicators. Pass translated labels in config for i18n.
Custom value formatter.Full type:
((value: ValueType, name: NameType, item: Payload<ValueType, NameType>, index: number, payload: Payload<ValueType, NameType>[]) => ReactNode).Custom label formatter.
Data key used to resolve the header label from config. Falls back to the first payload item’s
dataKey.Data key used to resolve the display name from config. Useful when the payload
name differs from the config key.resolveConfigEntry
Resolves theChartConfig entry for a given tooltip/legend payload item. Recharts wraps the original data point inside payload.payload — this function checks both levels before falling back to a direct key lookup.
Takes no props of its own beyond the standard attributes of the element it renders.
useChart
Access the nearestChartContainer’s config. Throws if used outside a chart.
Takes no props of its own beyond the standard attributes of the element it renders.
Exported types
Also exported from@fanvue/ui/charts: ChartCardProps, ChartCenterLabelProps, ChartConfig, ChartConfigEntry, ChartContainerProps, ChartGridProps, ChartLegendContentProps, ChartLoadingOverlayProps, ChartMetricTrendColor, ChartMetricTrendProps, ChartPieLegendItem, ChartPieLegendProps, ChartSeriesToggleItem, ChartSeriesToggleProps, ChartSkeletonProps, ChartSkeletonVariant, ChartStyleProps, ChartThemeKey, ChartTooltipContentProps, ChartTooltipIndicator.
Setup: Installation · Theming · Subpath exports