Skip to main content

Interface: ICustomSymbolStatusAdapter

Charting Library.ICustomSymbolStatusAdapter

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.

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

Methods​

getColor​

getColor(): string

Get the current color of the status item.

Returns​

string — the current color


getDropDownContent​

getDropDownContent(): CustomStatusDropDownContent[]

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

Returns​

CustomStatusDropDownContent[] — the current pop-up content


getIcon​

getIcon(): string

Get the current icon for the status item.

Returns​

string — the current icon SVG string


getTooltip​

getTooltip(): string

Get the current tooltip text for the status item.

Returns​

string — the current tooltip text


getVisible​

getVisible(): boolean

Get the current visibility of the status item.

Returns​

boolean — the current visibility


setColor​

Set the color for the status item.

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​

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

'#9598a1'

setDropDownContent​

setDropDownContent(content): ICustomSymbolStatusAdapter

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

Parameters​

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

Returns​

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

null

setIcon​

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

Parameters​

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

Returns​

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

blank

<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>

setTooltip​

setTooltip(tooltip): ICustomSymbolStatusAdapter

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

Parameters​

NameTypeDescription
tooltipstringtext to be displayed within the tooltip.

Returns​

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

''

setVisible​

setVisible(visible): ICustomSymbolStatusAdapter

Set the visibility for the status item.

Parameters​

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

Returns​

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

false