Skip to main content

gauge: wins out of 17 as a half circle in each team's colour

AFC, 2024
TeamWinsPoints for
KCGauge: 15 on a scale from 0 to 1715017Gauge: 385 on a scale from 250 to 525385
LACGauge: 11 on a scale from 0 to 1711017Gauge: 402 on a scale from 250 to 525402
DENGauge: 10 on a scale from 0 to 1710017Gauge: 425 on a scale from 250 to 525425
LVGauge: 4 on a scale from 0 to 174017Gauge: 309 on a scale from 250 to 525309
BUFGauge: 13 on a scale from 0 to 1713017Gauge: 525 on a scale from 250 to 525525
MIAGauge: 8 on a scale from 0 to 178017Gauge: 345 on a scale from 250 to 525345
NYJGauge: 5 on a scale from 0 to 175017Gauge: 338 on a scale from 250 to 525338
NEGauge: 4 on a scale from 0 to 174017Gauge: 289 on a scale from 250 to 525289
import { STANDINGS, type Standing } from "@sportsdataverse/examples/data";
import { defineTable } from "@sportsdataverse/sdvtables";
import { renderHTMLAsync } from "@sportsdataverse/sdvtables/html";

// reactablefmtr gauge_chart: the arc fills |value| of the way from minValue (0) to maxValue (here a 17-game season;
// by default the column's largest value). team + league colour each gauge; showMinMax prints the scale's ends.
const spec = defineTable<Standing>()
.columns((c) => [
c.text("team"),
c.gauge("wins", {
label: "Wins",
team: "team",
league: "nfl",
maxValue: 17,
showMinMax: true,
boldText: true,
}),
c.gauge("pf", { label: "Points for", fill: ["#C84630", "#EDE0CC", "#3D8B6E"], minValue: 250 }),
])
.title("AFC, 2024")
.build();
await renderHTMLAsync(spec, STANDINGS);

Tags: kind · gauge · gauge_chart · reactablefmtr · nfl. All sdvtables examples.