| month | Projects published |
|---|---|
| January | 24 |
| February | 31 |
| March | 28 |
| April | 35 |
| May | 42 |
| June | 38 |
<Chart.LabelList marks="bars" />API
| Prop | Type | Default | |
|---|---|---|---|
formatter | ((value: number) => string) | formatTickValue | Formats each label. Use it for units and locale — the raw number is passed in. |
gap | number | — | Mirrors Chart.Bars; only read when marks is bars. |
marks | "bars" | "points" | "points" | Which mark the labels belong to, because the two anchor differently. points (the default) puts each label on the series point — right for
Chart.Line, Chart.Area and Chart.Points. bars puts it at the end of that series' OWN bar. A grouped bar chart
splits its category slot into one lane per series, while the series point
sits at the centre of the whole slot — so the label lands over the middle
of the group rather than over the bar it describes. With a single series
the two coincide, which is why this only appears once a second key is
added. Stacked bars have the same problem for a different reason: every
segment but the first starts off a running total, not the baseline. Pass bars beside any Chart.Bars, mirroring the stacked and gap you
gave it so the lanes line up. |
offset | number | 8 | Distance from the mark, along the value axis. |
seriesKey | string | — | Series to label. Defaults to the first of the root's value keys. |
stacked | boolean | — | Mirrors Chart.Bars; only read when marks is bars. |
Plus every <g> prop. Source: chart/components/chart-label-list.tsx.
marks is the prop that catches people out: labels anchor to the series point
by default, which is right for lines and areas but lands over the middle of a
grouped bar chart rather than over the bar being described. Pass bars beside
any Chart.Bars, mirroring its stacked and gap.