TopBar¶
- class TopBar¶
The
TopBarclass represents the top bar shown on the chart:
This object is accessed from the
topbarattribute of the chart object (chart.topbar.<method>).Switchers, text boxes and buttons can be added to the top bar, and their instances can be accessed through the
topbardictionary. For example:chart.topbar.textbox('symbol', 'AAPL') # Declares a textbox displaying 'AAPL'. print(chart.topbar['symbol'].value) # Prints the value within 'symbol' -> 'AAPL' chart.topbar['symbol'].set('MSFT') # Sets the 'symbol' textbox to 'MSFT' print(chart.topbar['symbol'].value) # Prints the value again -> 'MSFT'
Topbar widgets share common parameters:
name: The name of the widget which can be used to access it from thetopbardictionary.align: The alignment of the widget (either'left'or'right'which determines which side of the topbar the widget will be placed upon.
- switcher(name: str, options: tuple: default: str, align: ALIGN, func: callable)¶
options: The options for each switcher item.default: The initial switcher option set.
options: The options for each menu item.default: The initial menu option set.separator: places a separator line to the right of the menu.
- textbox(name: str, initial_text: str, align: ALIGN)¶
initial_text: The text to show within the text box.