Skip to main content

scaleNote: columns divided, with a note saying so

AFC, 2024
TeamPF / gPA / g
22.619.2
23.617.7
25.018.3
18.225.5
30.921.6
20.321.4
19.923.8
17.024.5
Points per game (17 games).
import { STANDINGS, type Standing } from "@sportsdataverse/examples/data";
import { defineTable } from "@sportsdataverse/sdvtables";
import { renderHTMLAsync } from "@sportsdataverse/sdvtables/html";

// Any divisor works; 1,000 and 1,000,000 come with their own wording ("Figures in thousands.").
const spec = defineTable<Standing>()
.columns((c) => [
c.logo("team", { league: "nfl" }),
c.int("pf", { label: "PF" }),
c.int("pa", { label: "PA" }),
])
.scaleNote(["pf", "pa"], {
divisor: 17,
decimals: 1,
where: "both",
note: "Points per game (17 games).",
labelSuffix: "/ g",
})
.title("AFC, 2024")
.build();
await renderHTMLAsync(spec, STANDINGS);

Tags: decoration · scaleNote · gt_scale_note. All sdvtables examples.