Skip to content

Blocks

Blocks are the pieces of a row. Values are on the chart’s scale. Every block also takes class, style (an object), ref, color, children, event handlers (onClick…) and HTML attributes (title, data-*, aria-*).

color is a theme name ("series-1" to "series-6", "positive", "negative", "ink", "muted", "grid", "surface", "low", "high") or any CSS color.

Bar

<Bar from={2} to={d.value} thick="10px" />
PropDefault
from0where the bar starts
to0where it ends. Below from, the bar runs backward.
thickthe band less a margina size ("10px") or a share of the band (0.5)
colorseries-1

Dot

<Dot at={d.value} size="14px" />
PropDefault
atits value
size"10px"its diameter
across0.5where it sits across the band, from 0 to 1
colorseries-1

Tick

<Tick at={d.goal} thick={0.8} />
PropDefault
atits value
thickthe band less a marginits length across the band
colorink

Label

<Label at={d.value}>{d.value}</Label>
<Label edge="start">{d.name}</Label>
Prop
ata valuethe text starts just past it
side"before"with at: the text ends just before the value instead
edge"start" or "end"outside the chart: before it (names) or after it

Cell

<Cell value={h.count} />
Prop
valuecolored from the theme’s low (at the scale’s min) to high (at its max)
colora fixed color instead

Area

<Area points={[[7, 1], [9, 4], [12, 7], [19, 1]]} mirror />
PropDefault
points[value, height] pairs, sorted by value
peakthe largest heightthe height that fills the band
mirrorfalsedraw both ways from the band’s middle (violins)
colorseries-1