Interface: LegendOptions
Alignment of the legend.
default
‘center’
Defined in
display
• display: boolean
Is the legend shown?
default
true
Defined in
index.esm.d.ts:2129 (opens new window)
fullSize
• fullSize: boolean
Marks that this box should take the full width/height of the canvas (moving other boxes). This is unlikely to need to be changed in day-to-day use.
default
true
Defined in
labels
• labels: Object
Type declaration
Defined in
• maxHeight: number
Maximum height of the legend, in pixels
Defined in
maxWidth
• maxWidth: number
Maximum width of the legend, in pixels
Defined in
position
• position:
Position of the legend.
default
‘top’
Defined in
reverse
• reverse: boolean
Legend will show datasets in reverse order.
default
false
Defined in
index.esm.d.ts:2157 (opens new window)
• rtl: boolean
true for rendering the legends from right to left.
Defined in
index.esm.d.ts:2231 (opens new window)
textDirection
• textDirection: string
default
canvas’ default
Defined in
title
• title: Object
Type declaration
Defined in
Methods
onClick
▸ onClick(e
, legendItem
, legend
): void
A callback that is called when a click event is registered on a label item.
Parameters
Returns
void
Defined in
▸ onHover(e
, legendItem
, legend
): void
A callback that is called when a ‘mousemove’ event is registered on top of a label item
Parameters
Returns
void
Defined in
onLeave
▸ onLeave(e
, legendItem
, legend
): void
A callback that is called when a ‘mousemove’ event is registered outside of a previously hovered label item.