Labels and notes
| Field | Writes |
|---|---|
heading, subheading | text above the chart |
xTitle, axes[].title | axis titles |
showLabel | the value of each point or bar |
labels | your own text for each value |
labelAngle | turned category names |
format, axes[].format | every number, or the numbers of one axis |
lines | a target, an average, a date |
annotations | a note on a point |
From code
ts
chart.addLine({ value: 60, label: 'Average' });
chart.addAnnotation({ at: 'Feb', value: 73, text: 'Holiday' });
chart.clearNotes();Zones
A shaded zone marks a period (a forecast, a holiday) or a range of values (a target band), behind the series.
js
zones: [
{ from: 'Oct', to: 'Dec', label: 'Forecast' },
{ min: 80, max: 100, label: 'Target', color: '#2a9d8f' },
]Gauges take several marks (target: [100, 90], the first one thicker) and progress bars a mark and a second line each (target, detail).
Your own elements
decorate receives the SVG: add a header or a watermark, which exports keep.
ts
{ ...spec, insetTop: 40, decorate: ({ svg, width, theme }) => { /* append elements */ } }