Skip to content

grafit-charts


Interface: PartLabelBlockOptions<P>

A label made of the part name and its value, drawn as one block so the two always read together: each half carries its own font, layout puts the value on its own line or in the same row behind a separator.

Extends

Type Parameters

P

P = unknown

Properties

avoidOverlap?

optional avoidOverlap?: boolean

Drop a label there is no room for (default false). Off, every part gets its label and crowded ones are left to overlap; on, the largest parts ask for room first and the slivers are the ones that lose their labels.

Inherited from

PartLabelOptions.avoidOverlap


category?

optional category?: Switchable & FontOptions & Formattable<P>

Part name; its own font over the label's, and its own format for the field it comes from.


layout?

optional layout?: PartLabelLayout

'stacked' — the value on its own line under the name; 'inline' — one row.


minShare?

optional minShare?: number

Share of the total a part needs before it is worth labelling, 0..1 (0 by default — every part is). 0.02 reads as "label what is at least two percent" and leaves a long tail of slivers unlabelled, which is usually what makes a crowded chart legible. Combines with avoidOverlap: this decides which parts are worth a label, that one whether there is room for it — of two labels after the same spot the larger part wins.

Inherited from

PartLabelOptions.minShare


separator?

optional separator?: string

What separates the two halves of an inline label (' · ' by default).


value?

optional value?: PartValueLabelOptions<P>

Part value; its own font over the label's.