Blocks / Line chart

Line chart

A pixel step line over time. Hover or the arrows read a point; the values are a table too.

import { LineChart } from "@forgeron/ui";
/01 → Default
Signups
W4633

Left and right arrows read one point.

Signups
PointValue
W3512
W3614
W3713
W3817
W3916
W4021
W4119
W4224
W4326
W4425
W4529
W4633
import { LineChart } from "@forgeron/ui";

const weeks = [12, 14, 13, 17, 16, 21, 19, 24, 26, 25, 29, 33];

export default function Default() {
  return (
    <div style={{ width: 320 }}>
      <LineChart
        title="Signups"
        height={96}
        points={weeks.map((value, i) => ({ label: `W${35 + i}`, value }))}
      />
    </div>
  );
}
/02 → Against last period
Requests per day
Nov 17360before 320

Left and right arrows read one point.

Requests per day
PointValueBefore
Oct 21420380
Oct 22455400
Oct 23610520
Oct 24640560
Oct 25590540
Oct 26300280
Oct 27260240
Oct 28480430
Oct 29530470
Oct 30660580
Oct 31700610
Nov 1690600
Nov 2340300
Nov 3310280
Nov 4510450
Nov 5560500
Nov 6720630
Nov 7760660
Nov 8740650
Nov 9380330
Nov 10330300
Nov 11540480
Nov 12600520
Nov 13780680
Nov 14810700
Nov 15790690
Nov 16410350
Nov 17360320
import { LineChart } from "@forgeron/ui";

const days = [
  420, 455, 610, 640, 590, 300, 260, 480, 530, 660, 700, 690, 340, 310, 510, 560, 720, 760, 740,
  380, 330, 540, 600, 780, 810, 790, 410, 360,
];
const before = [
  380, 400, 520, 560, 540, 280, 240, 430, 470, 580, 610, 600, 300, 280, 450, 500, 630, 660, 650,
  330, 300, 480, 520, 680, 700, 690, 350, 320,
];
// Four weeks from Oct 21: the dotted line is the four weeks before.
const date = (i: number) => (i < 11 ? `Oct ${21 + i}` : `Nov ${i - 10}`);

export default function AgainstLastPeriod() {
  return (
    <div style={{ width: "100%" }}>
      <LineChart
        title="Requests per day"
        points={days.map((value, i) => ({ label: date(i), value }))}
        previous={before}
        format={(v) => v.toLocaleString("en")}
      />
    </div>
  );
}
/03 → Money
Revenue, 2026
Nov€48.2k

Left and right arrows read one point.

Revenue, 2026
PointValue
Jan€21.4k
Feb€23.8k
Mar€22.1k
Apr€27.6k
May€29.9k
Jun€31.2k
Jul€24.8k
Aug€22.3k
Sep€33.9k
Oct€41.7k
Nov€48.2k
import { LineChart } from "@forgeron/ui";

const months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov"];
const revenue = [21400, 23800, 22100, 27600, 29900, 31200, 24800, 22300, 33900, 41700, 48210];
const euros = (v: number) => `€${(v / 1000).toFixed(1)}k`;

export default function Money() {
  return (
    <div style={{ width: "100%", maxWidth: 480 }}>
      <LineChart
        title="Revenue, 2026"
        height={120}
        format={euros}
        points={months.map((label, i) => ({ label, value: revenue[i]! }))}
      />
    </div>
  );
}
API → Props
PropTypeDefaultDescription
titlestring—Names the chart; also its caption.
points{ label, value }[]—In order, oldest first.
previousnumber[]—The same points one period earlier, dotted in grey behind the line.
format(value: number) => stringStringWrites a value.
heightnumber160Of the plot, in px.
classNamestring—Extra classes.