Skip to content

Interface: D3PLegendPanelOptions ​

Defined in: core/legend-panel.ts:24

Options of the legend panel: where it goes (placement), its size, the renderers it lists, its props and the bus.

Properties ​

bus? ​

ts
bus?: D3PBus;

Defined in: core/legend-panel.ts:26

The bus the panel uses (the global bus by default).


placement? ​

ts
placement?: 
  | D3PSide
  | D3PLegendPanelCorner;

Defined in: core/legend-panel.ts:31

Where the legend goes: a side of the plot, from which it takes room (default bottom), or a corner of the plot, over it.


props? ​

ts
props?: object;

Defined in: core/legend-panel.ts:41

Initial props of the panel.

align? ​

ts
align?: "start" | "end" | "center";

Along the side, over the plot: the start, the middle or the end of it.

style? ​

ts
style?: object;

Color and size of the text, the gap between entries and the size of the swatch.

style.color? ​
ts
color?: string;
style.fontSize? ​
ts
fontSize?: number;
style.gap? ​
ts
gap?: number;
style.swatch? ​
ts
swatch?: number;

series? ​

ts
series?: readonly (
  | string
  | D3PSeriesRenderer<any, any>)[];

Defined in: core/legend-panel.ts:39

Restrict the legend to some renderers (objects or names).


size? ​

ts
size?: number;

Defined in: core/legend-panel.ts:37

Width of a strip on the left or the right (default 140). Above or under the plot the height follows the entries, which wrap onto as many lines as they need (at most a third of the chart, then the list scrolls); give a number to fix it. A corner takes no room.