legendContinuous: a stepped key for a colour scale
| Team | Net EPA/play |
|---|---|
![]() | 0.063 |
![]() | 0.101 |
![]() | 0.108 |
![]() | -0.146 |
![]() | 0.190 |
![]() | -0.019 |
![]() | -0.045 |
![]() |
Net EPA per play
import { STANDINGS, type Standing } from "@sportsdataverse/examples/data";
import { defineTable } from "@sportsdataverse/sdvtables";
import { renderHTMLAsync } from "@sportsdataverse/sdvtables/html";
// With no palette or domain of its own, the legend reads the scale the colorPills column recorded.
const spec = defineTable<Standing>()
.columns((c) => [
c.logo("team", { league: "nfl" }),
c.colorPills("net_epa", { label: "Net EPA/play", digits: 3, domain: [-0.2, 0.2] }),
])
.legendContinuous({ title: "Net EPA per play", digits: 1 })
.title("AFC, 2024")
.build();
await renderHTMLAsync(spec, STANDINGS);
Tags: decoration · legendContinuous · gt_legend_continuous · gt_color_legend. All sdvtables examples.







