Enhancements:

- added the `align` parameter to all topbar widgets, allowing for individual widgets to be placed either on the left or right hand side of the topbar.
- Disabled QtChart’s context menu by default.

Bug Fixes:
- The `screenshot` method now works for subcharts.
- Tables will still render if a `NoneType` is passed to them as a value.
- Qt and Wx charts no longer throw an error when using the toolbox.
This commit is contained in:
louisnw
2023-09-14 10:51:10 +01:00
parent 8f65a7fc96
commit b1f007f6d0
12 changed files with 104 additions and 71 deletions

View File

@ -17,6 +17,7 @@ tables
1. [`AbstractChart`](#AbstractChart)
2. [`Line`](#Line)
3. [`Histogram`](#Histogram)
3. [`HorizontalLine`](#HorizontalLine)
4. [Charts](#charts)
5. [`Events`](./events.md)

View File

@ -12,18 +12,22 @@ Switchers, text boxes and buttons can be added to the top bar, and their instanc
```python
chart.topbar.textbox('symbol', 'AAPL') # Declares a textbox displaying 'AAPL'.
print(chart.topbar['symbol'].value) # Prints the value within ('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')
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 the `topbar` dictionary.
* `align`: The alignment of the widget (either `'left'` or `'right'` which determines which side of the topbar the widget will be placed upon.
___
```{py:method} switcher(name: str, options: tuple: default: str, func: callable)
```{py:method} switcher(name: str, options: tuple: default: str, align: ALIGN, func: callable)
* `name`: the name of the switcher which can be used to access it from the `topbar` dictionary.
* `options`: The options for each switcher item.
* `default`: The initial switcher option set.
@ -32,9 +36,8 @@ ___
```{py:method} menu(name: str, options: tuple: default: str, separator: bool, func: callable)
```{py:method} menu(name: str, options: tuple: default: str, separator: bool, align: ALIGN, func: callable)
* `name`: the name of the menu which can be used to access it from the `topbar` dictionary.
* `options`: The options for each menu item.
* `default`: The initial menu option set.
* `separator`: places a separator line to the right of the menu.
@ -44,9 +47,8 @@ ___
```{py:method} textbox(name: str, initial_text: str)
```{py:method} textbox(name: str, initial_text: str, align: ALIGN)
* `name`: the name of the text box which can be used to access it from the `topbar` dictionary.
* `initial_text`: The text to show within the text box.
```
@ -54,9 +56,8 @@ ___
```{py:method} button(name: str, button_text: str, separator: bool, func: callable)
```{py:method} button(name: str, button_text: str, separator: bool, align: ALIGN, func: callable)
* `name`: the name of the text box to access it from the `topbar` dictionary.
* `button_text`: Text to show within the button.
* `separator`: places a separator line to the right of the button.
* `func`: The event handler which will be executed upon a button click.

View File

@ -33,6 +33,9 @@ Throughout the library, colors should be given as either rgb (`rgb(100, 100, 100
```{py:class} PRICE_SCALE_MODE(Literal['normal', 'logarithmic', 'percentage', 'index100'])
```
```{py:class} ALIGN(Literal['left', 'right'])
```