Line
<k.Line> draws one line per column of a result, over an x column such
as a month or a week. Use it for a measure over time, or several measures
on one scale. For parts of a whole, use StackedBars;
for one measure across categories, CategoryBars.
Example
monthly.sql:
-- Sales and target per month
select '2026-01' as month, 120 as sales, 110 as target
union all select '2026-02', 135, 115
union all select '2026-03', 128, 120
union all select '2026-04', 150, 125
In report.tsx:
import monthly from "./monthly.sql?raw"
type Row = { month: string; sales: number; target: number }
// in defineReport({ … })
queries: { monthly: query<Row>(monthly) },
blocks: (k) => [
<k.Line
key="sales"
series="monthly"
x="month"
xFormat="month"
y={{ sales: "Sales", target: "Target" }}
dashed={["target"]}
title="Sales per month"
info={{ what: "Sales against the monthly target.", sql: ["monthly"] }}
/>,
],
Props
Also key, description, span (default 1) and info: see
Props every block takes.
Checks
A series that is not one of the report's queries, or a column it names
that the query's rows do not have, fails the typecheck, as does a missing
required prop or a value of the wrong type.