Skip to content

Labels and notes ​

FieldWrites
heading, subheadingtext above the chart
xTitle, axes[].titleaxis titles
showLabelthe value of each point or bar
labelsyour own text for each value
labelAngleturned category names
format, axes[].formatevery number, or the numbers of one axis
linesa target, an average, a date
annotationsa note on a point

From code ​

ts
chart.addLine({ value: 60, label: 'Average' });
chart.addAnnotation({ at: 'Feb', value: 73, text: 'Holiday' });
chart.clearNotes();

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 */ } }

MIT License