Skip to main content
Version: v25

ICustomSymbolStatusAdapter

Interface

Adapter API for reading and setting the state of a custom symbol status item.

The 'set' methods return the same adapter so that you can chain multiple set functions together.

Example

const adapter = widget.customSymbolStatus().symbol('ABC');
adapter.setVisible(true).setColor('#336699').setTooltip('Custom Status')

Methods

getColor

Get the current color of the status item.

Signature

getColor() => string

Returns

the current color

string


getDropDownContent

Get the current content of the status item displayed within the pop-up tooltip.

Signature

getDropDownContent() => CustomStatusDropDownContent[]

Returns

the current pop-up content

CustomStatusDropDownContent[]


getIcon

Get the current icon for the status item.

Signature

getIcon() => string

Returns

the current icon SVG string

string


getTooltip

Get the current tooltip text for the status item.

Signature

getTooltip() => string

Returns

the current tooltip text

string


getVisible

Get the current visibility of the status item.

Signature

getVisible() => boolean

Returns

the current visibility

boolean


setColor

Set the color for the status item.

Default

'#9598a1'

Signature

setColor(color: string) => ICustomSymbolStatusAdapter

Parameters

NameTypeDescription
colorstringcolor to be used for the status item. It is recommended that you test that the color works well for both light and dark themes.

Returns

the current symbol status adapter so you can chain 'set' functions together.

ICustomSymbolStatusAdapter


setDropDownContent

Set the content to be displayed within the pop-up which appears when the user clicks on the symbol statuses.

Default

null

Signature

setDropDownContent(content: CustomStatusDropDownContent[]) => ICustomSymbolStatusAdapter

Parameters

NameTypeDescription
contentCustomStatusDropDownContent[]content to be displayed, set to null to display nothing. More than one section can be specified.

Returns

the current symbol status adapter so you can chain 'set' functions together.

ICustomSymbolStatusAdapter


setIcon

Set the icon for the status item.

Default

blank The icon should be provided as an svg markup. It is recommended that the icon works well at small sizes.

Example

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">
<!-- Icon source: https://heroicons.com -->
<path fill-rule="evenodd" d="M13.5 4.938a7 7 0 11-9.006 1.737c.202-.257.59-.218.793.039.278.352.594.672.943.954.332.269.786-.049.773-.476a5.977 5.977 0 01.572-2.759 6.026 6.026 0 012.486-2.665c.247-.14.55-.016.677.238A6.967 6.967 0 0013.5 4.938zM14 12a4 4 0 01-4 4c-1.913 0-3.52-1.398-3.91-3.182-.093-.429.44-.643.814-.413a4.043 4.043 0 001.601.564c.303.038.531-.24.51-.544a5.975 5.975 0 011.315-4.192.447.447 0 01.431-.16A4.001 4.001 0 0114 12z" clip-rule="evenodd" />
</svg>

Signature

setIcon(icon: string) => ICustomSymbolStatusAdapter

Parameters

NameTypeDescription
iconstringsvg markup string to be used as the icon, or null to display no icon

Returns

the current symbol status adapter so you can chain 'set' functions together.

ICustomSymbolStatusAdapter


setTooltip

Set the text to be displayed within the tooltip displayed when hovering over the statuses for the symbol.

Default

''

Signature

setTooltip(tooltip: string) => ICustomSymbolStatusAdapter

Parameters

NameTypeDescription
tooltipstringtext to be displayed within the tooltip.

Returns

the current symbol status adapter so you can chain 'set' functions together.

ICustomSymbolStatusAdapter


setVisible

Set the visibility for the status item.

Default

false

Signature

setVisible(visible: boolean) => ICustomSymbolStatusAdapter

Parameters

NameTypeDescription
visiblebooleanvisibility for the status item, where true makes the item visible.

Returns

the current symbol status adapter so you can chain 'set' functions together.

ICustomSymbolStatusAdapter