update docs

This commit is contained in:
louisnw
2024-05-29 19:02:03 +01:00
parent 8ff980abfc
commit 19a4f5f114
7 changed files with 12 additions and 13 deletions

View File

@ -1,7 +1,7 @@
# Alternative GUI's
## PyQt5 / PySide6
## PyQt6 / PyQt5 / PySide6
```python
import pandas as pd

View File

@ -36,7 +36,7 @@ def on_timeframe_selection(chart):
if new_data.empty:
return
# The symbol has not changed, so we want to re-render the drawings.
chart.set(new_data, render_drawings=True)
chart.set(new_data, keep_drawings=True)
if __name__ == '__main__':

View File

@ -22,7 +22,7 @@ The `websockets` library is required when using live data.
```{important}
When using live data and the standard `show` method, the `block` parameter __must__ be set to `True` in order for the data to congregate on the chart (`chart.show(block=True)`).
If `show_async` is used with live data, `block` can be either value.
`show_async` can also be used with live data.
```

View File

@ -8,7 +8,7 @@ ___
```{py:method} set(data: pd.DataFrame, render_drawings: bool = False)
```{py:method} set(data: pd.DataFrame, keep_drawings: bool = False)
Sets the initial data for the chart.
@ -17,7 +17,7 @@ Columns should be named:
Time can be given in the index rather than a column, and volume can be omitted if volume is not used. Column names are not case sensitive.
If `render_drawings` is `True`, any drawings made using the `toolbox` will be redrawn with the new data. This is designed to be used when switching to a different timeframe of the same symbol.
If `keep_drawings` is `True`, any drawings made using the `toolbox` will be redrawn with the new data. This is designed to be used when switching to a different timeframe of the same symbol.
`None` can also be given, which will erase all candle and volume data displayed on the chart.
```
@ -27,7 +27,7 @@ ___
```{py:method} update(series: pd.Series, render_drawings: bool = False)
```{py:method} update(series: pd.Series, keep_drawings: bool = False)
Updates the chart data from a bar.
Series labels should be akin to [`set`](#AbstractChart.set).

View File

@ -45,7 +45,7 @@ ___
```{py:method} show_async(block: bool)
```{py:method} show_async()
:async:
Show the chart asynchronously.
@ -85,7 +85,7 @@ ___
The `QtChart` object allows the use of charts within a `QMainWindow` object, and has similar functionality to the `Chart` object for manipulating data, configuring and styling.
Either the `PyQt5` or `PySide6` libraries will work with this chart.
Either the `PyQt5`, `PyQt6` or `PySide6` libraries will work with this chart.
Callbacks can be received through the Qt event loop.
___

View File

@ -101,7 +101,7 @@ async def update_clock(chart):
async def main():
chart = Chart()
chart.topbar.textbox('clock')
await asyncio.gather(chart.show_async(block=True), update_clock(chart))
await asyncio.gather(chart.show_async(), update_clock(chart))
if __name__ == '__main__':
@ -130,7 +130,6 @@ async def data_loop(chart):
return
chart.update_from_tick(ticks.iloc[i])
await asyncio.sleep(0.03)
i += 1
def on_new_bar(chart):
@ -150,7 +149,7 @@ async def main():
df = pd.read_csv('ohlc.csv')
chart.set(df)
await asyncio.gather(chart.show_async(block=True), data_loop(chart))
await asyncio.gather(chart.show_async(), data_loop(chart))
if __name__ == '__main__':