import "./line_chart.css"; import type * as React from "react"; import { useRender } from "@base-ui/react/use-render"; import { type StyleProps } from "./style_props"; export interface LineChartPoint { x: string | number; y: number; } export interface LineChartSeries { key: string; /** The series' name — its legend entry and the line's accessible name. */ label: string; /** Omit to take the next colour off the chart's own order. */ color?: string; points: LineChartPoint[]; } interface LineChartBaseProps extends StyleProps { height?: number; formatNumber?: (n: number) => string; formatXLabel?: (x: string | number) => string; emptyLabel?: string; /** * Render the series legend above the plot. Defaults to ON once there is more * than one series — several lines with no key is a picture nobody can read — * and OFF for a single one. */ legend?: boolean; testID?: string; ref?: React.Ref; render?: useRender.RenderProp; } /** * ONE series or SEVERAL, never both: `points` is the single-line form (with its * own `lineColor`), `series` the multi-line one. A union, so passing both or * neither fails to compile rather than resolving to whichever the body reads * first. */ export type LineChartProps = LineChartBaseProps & ({ points: LineChartPoint[]; series?: undefined; lineColor?: string; } | { series: LineChartSeries[]; points?: undefined; lineColor?: undefined; }); /** * The canonical SVG line chart — `points: { x, y }[]` for one line, `series` for * several on ONE SHARED y-scale (this period against last, a measure per site). * `formatNumber`/`formatXLabel` for the axes, `height` for the plot. (No * recharts.) For a tiny inline trend use `Sparkline`. */ export declare function LineChart(props: LineChartProps): React.ReactElement>; export {};