Lambchop
Charts

LineChart

Line chart with multiple lines, tooltips, and legends.

import { LineChart } from "lambchop";

Live Demo

Usage

import { LineChart } from "lambchop";

<LineChart
  data={[
    { date: "Jan 1", revenue: 1250 },
    { date: "Jan 2", revenue: 1380 },
  ]}
  xKey="date"
  lines={[{ key: "revenue", label: "Revenue" }]}
/>

Props

PropTypeDefaultDescription
dataRecord<string, unknown>[]Array of data objects
xKeystringKey for the x-axis
linesLineDefinition[]Line series definitions
heightnumber300Chart height in pixels
classNamestringAdditional CSS classes

LineDefinition

FieldTypeDefaultDescription
keystringData key for this line series
labelstringLegend label
colorstringautoOverride the default color

Variants

  • Single Line — Track one metric over time
  • Multiple Lines — Compare multiple series with tooltips and legend
  • Custom Colors — Override the default palette