Line Chart
Documentation Index
Fetch the complete documentation index at: /llms.txt. Use this file to discover all available pages before exploring further.
Simple static & beautifully designed line charts
Installation
Usage
The line chart is composible. <BeeLineChart> is the container, and you compose only the parts you need — <Grid>, <XAxis>, <YAxis>, <Legend>, <Tooltip>, and one or more <Line> — as its children. Each <Line> carries its own strokeVariant, curveType, glowing, enableBufferLine, and isClickable, so a single chart can mix stroke styles and make only some series interactive.
import {
BeeLineChart,
Line,
XAxis,
Grid,
Tooltip,
Legend,
} from "@/components/beecharts/charts/line-chart";const chartConfig = {
desktop: {
label: "Desktop",
colors: { light: ["#047857"], dark: ["#10b981"] },
},
mobile: {
label: "Mobile",
colors: { light: ["#be123c"], dark: ["#f43f5e"] },
},
} satisfies ChartConfig;
<BeeLineChart data={data} config={chartConfig} xDataKey="month">
<Grid />
<XAxis dataKey="month" />
<Legend />
<Tooltip />
<Line dataKey="desktop" />
<Line dataKey="mobile" curveType="monotone" />
</BeeLineChart>Uses the same desktop / mobile traffic dataset as the bar and composed basic previews.
Loading State
Pass isLoading on <BeeLineChart> while data is fetching. The chart shows a loading overlay on top of the composed chart area.
More examples
Curve, stroke, buffer, and glow previews are being ported from the Recharts-era docs. See the API reference for supported <Line> props on ECharts.
API Reference
The chart is composed of several parts. The props below are grouped by the component they belong to.
The root container. It owns the data, the shared selection state, the loading skeleton, and the optional brush. Everything visual is composed as its children.
A single line series. Each <Line /> is self-contained and generates its own gradient and glow definitions, so a chart can hold any number of lines — each with its own stroke, glow, and clickability.
Point markers composed inside a <Line />. <Dot /> is the resting marker; <ActiveDot /> is the hovered marker. They render nothing on their own — the parent <Line /> reads their variant.
The category and value axes. Both ship with the chart's flat default styling and forward every Recharts axis prop, so dataKey, tickFormatter, tickMargin, etc. pass straight through. They are hidden automatically while the chart is loading.
The background grid lines. Defaults to horizontal-only dashed lines and forwards every Recharts CartesianGrid prop.
The hover tooltip. It reads the chart's selection state so its content dims unselected series.
The series legend. When the chart is clickable, each entry toggles selection of its series.