Skip to main content

Interface: ICustomSymbolStatusApi

Charting Library.ICustomSymbolStatusApi

This API allows you to create custom sections in the Market Status popup to display additional information on a symbol, such as warnings. You can also customize the icon, color, tooltip, and content.

The API is designed to specify sections for a certain symbol. To do this, you should pass symbolId to the symbol method. Note that symbolId should match the ID of the resolved symbol that you can retrieve using the IChartWidgetApi.symbol method.

Example

widget
.customSymbolStatus()
.symbol('NASDAQNM:AAPL') // select the symbol
.setVisible(true) // make the status visible
.setColor('rgb(255, 40, 60)') // set the color
.setIcon(myCustomIconSvgString) // string for an svg icon, i.e. '<svg> ... </svg>'
.setTooltip('Tooltip') // text to be displayed within the hover tooltip
.setDropDownContent([ // content to be displayed within the large pop-up tooltip
{
title: 'Title', // title to be displayed within the pop-up
color: 'rgb(255, 60, 70)', // optional, if you want it to be different to above
content: [
'Explanation of status',
'<br/><br/>',
'More details...',
],
action: { // Optional action to be displayed
text: 'Read more here',
tooltip: 'opens in a new window',
onClick: () => {
window.open('https://www.tradingview.com/', '_blank');
},
},
},
]);

Methods

hideAll

hideAll(): void

Hide all the custom status items. This is equivalent to using setVisible(false) on all of the current custom symbol status items.

Returns

void


symbol

symbol(symbolId): ICustomSymbolStatusAdapter

Get the custom symbol status adapter for a specific symbolId. The symbolId should exactly match the resolved symbolId. This id can be retrieved for a chart via the IChartWidgetApi.symbol method.

Parameters

NameTypeDescription
symbolIdstringsymbol id for which you would like to create / adjust the custom status

Returns

ICustomSymbolStatusAdapter