Charts

Copy-paste chart examples for every Bklit UI component.

Live Line Chart - Interactive

Real-time streaming with crosshair and animated axes

<LiveLineChart margin={{ top: 8, right: 8, bottom: 40, left: 8 }} data={data} value={value} window={30}>  <LiveLine dataKey="value" stroke="var(--chart-line-primary)" formatValue={(v) => `$${v.toFixed(2)}`} />  <ChartTooltip showDatePill={false} content={TooltipContent} />  <LiveXAxis />  <LiveYAxis position="left" formatValue={(v) => `$${v.toFixed(2)}`} /></LiveLineChart>

Data streams in real time; hover to scrub the crosshair

Live Line Chart

Streaming data with smooth scroll, live dot, and crosshair

<LiveLineChart margin={{ top: 8, right: 8, bottom: 40, left: 8 }} data={data} value={value} window={30}>  <LiveLine dataKey="value" stroke="var(--chart-1)" formatValue={(v) => `$${v.toFixed(2)}`} />  <ChartTooltip showDatePill={false} content={TooltipContent} />  <LiveXAxis />  <LiveYAxis position="left" formatValue={(v) => `$${v.toFixed(2)}`} /></LiveLineChart>

Trending up by 5.2% this month

Live Line - Now Offset

Leading gap so the line fades at the right edge

<LiveLineChart margin={{ top: 8, right: 8, bottom: 40, left: 8 }} data={data} value={value} window={20} nowOffsetUnits={1}>  <LiveLine dataKey="value" stroke="var(--chart-3)" formatValue={formatSats} dotSize={4} />  <LiveXAxis />  <LiveYAxis position="left" formatValue={formatSats} /></LiveLineChart>

Trending up by 5.2% this month

Live Line - Momentum Colors

Green for increase, red for decrease

const momentumColors = { up: "var(--chart-positive)", down: "var(--chart-negative)", flat: "var(--muted-foreground)" };<LiveLineChart margin={{ top: 8, right: 8, bottom: 40, left: 8 }} data={data} value={value} window={25}>  <LiveLine dataKey="value" momentumColors={momentumColors} formatValue={formatUsd} dotSize={5} />  <LiveXAxis />  <LiveYAxis position="left" formatValue={formatUsd} /></LiveLineChart>

Trending up by 5.2% this month

Live Line - Line Only

No area fill — simple line and live dot

<LiveLineChart margin={{ top: 8, right: 8, bottom: 40, left: 8 }} data={data} value={value} window={28}>  <LiveLine dataKey="value" fill={false} stroke="var(--chart-1)" formatValue={formatUsd} />  <LiveXAxis />  <LiveYAxis position="left" formatValue={formatUsd} /></LiveLineChart>

Trending up by 5.2% this month

Live Line - Pattern Background

Diagonal pattern fill instead of grid lines

<LiveLineChart margin={{ top: 8, right: 8, bottom: 40, left: 28 }} data={data} value={value} window={30}>  <Background />  <LiveLine dataKey="value" stroke="var(--chart-1)" formatValue={formatUsd} />  <LiveXAxis />  <LiveYAxis position="left" formatValue={formatUsd} /></LiveLineChart>

Trending up by 5.2% this month

Live Line - Dot Grid Background

Dot grid texture with edge fade

<LiveLineChart margin={{ top: 8, right: 8, bottom: 40, left: 28 }} data={data} value={value} window={30}>  <Background pattern="dots" opacity={0.85} />  <LiveLine dataKey="value" stroke="var(--chart-1)" formatValue={formatUsd} />  <LiveXAxis />  <LiveYAxis position="left" formatValue={formatUsd} /></LiveLineChart>

Trending up by 5.2% this month

Live Line - Reference Band

Target price band with dashed edges and bracket markers

<LiveLineChart margin={{ top: 8, right: 8, bottom: 40, left: 28 }} data={data} value={value} window={30}>  <ReferenceArea y1={138} y2={148} strokeStyle="dashed" showMarkers />  <LiveLine dataKey="value" stroke="var(--chart-1)" formatValue={formatUsd} />  <LiveXAxis />  <LiveYAxis position="left" formatValue={formatUsd} /></LiveLineChart>

See /docs/utility/reference-area

Live Line - Pattern Reference Band

Pattern fill inside the band with colored Y-axis ticks

<LiveLineChart margin={{ top: 8, right: 8, bottom: 40, left: 28 }} data={data} value={value} window={30}>  <ReferenceArea    y1={138}    y2={148}    pattern="diagonal"    patternColor="var(--chart-foreground-muted)"    axisLabelColor="var(--chart-1)"    fillOpacity={0.85}  />  <LiveLine dataKey="value" stroke="var(--chart-1)" formatValue={formatUsd} />  <LiveXAxis />  <LiveYAxis position="left" formatValue={formatUsd} /></LiveLineChart>

Trending up by 5.2% this month