legend section controls where the legend sits and how it presents series. A legend appears automatically when a chart maps color (or group) to more than one series.
Options
Where the legend sits.
'none' hides it; 'auto' lets the engine choose
based on the chart.How series are labelled:
'pill'— a boxed legend with a swatch and label per series.'direct'— labels drawn next to each series’ endpoint, no separate legend box. Reads well on line charts.'auto'— resolved during compilation from the chart type and legend position.
Direct labels
Combinedisplay: 'direct' with position to steer which side the labels flow toward:
Hiding the legend
Related
- Mappings & aesthetics —
colorandgroupcreate series - Scales — the color scale that assigns series their swatches

