chart/01-basic-line
A line chart with axes, grid lines, and a tooltip for inspecting values.
Loading interactive preview
import { Chart } from 'ui-lab-components/chart';
const data = [
{ month: 'Jan', revenue: 42 },
{ month: 'Feb', revenue: 58 },
{ month: 'Mar', revenue: 51 },
{ month: 'Apr', revenue: 76 },
{ month: 'May', revenue: 68 },
{ month: 'Jun', revenue: 89 }
];
export default function Example() {
return (
<Chart data={data} x="month" aria-label="Monthly revenue">
<Chart.Grid />
<Chart.Axis axis="x" />
<Chart.Axis axis="y" />
<Chart.Line y="revenue" label="Revenue" />
<Chart.Tooltip />
</Chart>
);
}