Interface: TypeColorLegendConfigInterface
Extends
Properties
noDataMessage?
optionalnoDataMessage:string|false
Text to display when there is no data. When set to false, this message will not be displayed.
Default
'No data'Inherited from
DisplayStateConfigInterface.noDataMessage
loadingMessage?
optionalloadingMessage:string|false
Text to display when data is loading. When set to false, this message will not be displayed.
Default
'Data loading...'Inherited from
DisplayStateConfigInterface.loadingMessage
disableStateMessages?
optionaldisableStateMessages:boolean
Whether to disable all messages in the DisplayState element.
Default
falseInherited from
DisplayStateConfigInterface.disableStateMessages
allowPointerEvents?
optionalallowPointerEvents:boolean
Whether to allow pointer events on the DisplayState element when message is visible.
Default
falseInherited from
DisplayStateConfigInterface.allowPointerEvents
hidden?
optionalhidden:boolean
Whether to hide the legend.
Default: false
label?
optionallabel:string
The label for the color legend.
Default
undefineditems?
optionalitems:TypeColorLegendItem[]
An array of color legend items, where each item has a color and a label. These items will be displayed in the legend, with each item showing its color and label.
Default
[]alignRight?
optionalalignRight:boolean
Whether to align the color legend items to the right. When true, the legend items will be right-aligned within their container.
Default
falsemaxDisplayedItems?
optionalmaxDisplayedItems:number
The maximum number of color legend items to display. When exceeded, a âshow moreâ button will appear to display additional items.
Default
15labelFormatter()?
optionallabelFormatter: (n) =>string
The label formatter function to format the legend labels.
Parameters
| Parameter | Type | Description |
|---|---|---|
n | string | The label string to format |
Returns
string
The formatted label string
enableEvents?
optionalenableEvents:boolean
Whether to enable event handling for the color legend. When true, click and hover events will be active on legend items.
Default
trueexpanded?
optionalexpanded:boolean
Whether the color legend list (if âshow moreâ is active) is expanded or not.
Default
falseonClick()?
optionalonClick: (e,item?) =>void
Callback function that is called when a color legend item is clicked.
Parameters
| Parameter | Type | Description |
|---|---|---|
e | Event | The click event object |
item? | TypeColorLegendItem | The color legend item that was clicked, or undefined if no item was clicked |
Returns
void
onHover()?
optionalonHover: (e,item?) =>void
Callback function that is called when the mouse hovers over a color legend item.
Parameters
| Parameter | Type | Description |
|---|---|---|
e | Event | The hover event object |
item? | TypeColorLegendItem | The color legend item that was hovered over, or undefined if no item is being hovered |
Returns
void
onShowMoreClick()?
optionalonShowMoreClick: (expanded) =>void
Callback function that is called when the âshow moreâ button is clicked.
Parameters
| Parameter | Type | Description |
|---|---|---|
expanded | boolean | Whether the list is expanded or collapsed |
Returns
void