Chart
import { Chart } from '@editora/ui-react';
<Chart
type="bar"
title="Weekly signups"
data={[
{ label: 'Mon', value: 12 },
{ label: 'Tue', value: 18 },
{ label: 'Wed', value: 9 }
]}
showLegend
onPointSelect={(detail) => console.log(detail.label, detail.value)}
/>;
Compound usage:
<Chart.Root type="area" series={series} valueSuffix="%">
<Chart.Title>Revenue comparison</Chart.Title>
<Chart.Subtitle>Last 12 months</Chart.Subtitle>
<Chart.Header>
<button>Last 12 months</button>
</Chart.Header>
</Chart.Root>
Key Props
data, values, labels, type, variant, title, subtitle, state, disabled, interactive, showLegend, showSummary, headless, ariaLabel, onPointSelect
Additional data-display props:
series: multi-series chart input for line, area, step, scatter, and grouped bar chartsvaluePrefix/valueSuffix: format axis, tooltip, and summary valuesslot="header": inject custom filter/date controls above the chart surface
Notes
- Use either
dataor pairedvaluesandlabels. - Use
serieswhen you need comparison lines, multi-metric tooltips, or grouped bars. donutandradialcurrently use the primary series only.Chart.Headermaps to the chart'sslot="header"toolbar region.Chart.TitleandChart.Subtitlemap to slotted header text regions and override thetitle/subtitleprop fallback.