BarsWithLine
<k.BarsWithLine> draws one column as bars and another as a line. Use it
for a volume and a rate that belong together: orders as bars, the return
rate as a line. The two axes share their zero. When the two are not a count
and its rate, separate draws the line in its own plot under the bars.
Example
monthly.sql:
-- Orders and return rate per month
select '2026-01' as month, 410 as orders, 4.2 as return_rate
union all select '2026-02', 455, 3.8
union all select '2026-03', 430, 5.1
union all select '2026-04', 498, 4.6
In report.tsx:
import monthly from "./monthly.sql?raw"
type Row = { month: string; orders: number; return_rate: number }
// in defineReport({ … })
queries: { monthly: query<Row>(monthly) },
blocks: (k) => [
<k.BarsWithLine
key="orders"
series="monthly"
x="month"
xFormat="month"
bar="orders"
line="return_rate"
labels={{ orders: "Orders", return_rate: "Return rate" }}
title="Orders and returns"
info={{ what: "Orders per month, and the share returned.", 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.