Bug Fixes/Enhancements:

- Added the chart.spinner method, which when set to `True` shows a loading spinner on the chart (a nice visual for API calls, large datasets etc).
- If an empty data frame is passed to set (eg.`chart.set(pd.DataFrame())`) the volume series and candle series will be cleared.
- added the `cumulative_volume` parameter to `update_from_tick`, which adds the given volume tick onto the latest bar.
- Added `vert_visible` and `horz_visible` parameters to `crosshair`.
- Small style improvements to the searchbox and topbar.
- Fixed a bug preventing callbacks within `WxChart` and `QtChart`

Thanks to @emma-uw for the following fixes and enhancements!
- Methods `hide_data`, `show_data`  and `price_line` can be used within Charts, Subcharts and Lines to change the visibility of data, price lines, and the price line labels.
- Added the `delete` method to Line, which irreversably deletes the Line on the chart as well as its objects in JavaScript and Python.
- Added the `lines` common method, which returns a list of all Line objects for the chart.
- Added the `fit` method to the common methods, which uses the `fitContent()` method from Lightweight Charts.
- Fixed a big which caused synced SubCharts to be out of sync upon loading.

BETA: Polygon.io integration
- Added the `PolygonChart` and `polygon` method, allowing for direct integration of polygon.io’s API.
- This feature is still in beta, and there will be a full announcement and update once the feature is complete!
This commit is contained in:
louisnw
2023-06-10 14:34:46 +01:00
parent 3463f8635f
commit 345b37e0f3
8 changed files with 602 additions and 78 deletions

View File

@ -26,6 +26,8 @@ The `time` column can also be named `date`, and the `volume` column can be omitt
```{important}
the `time` column must have rows all of the same timezone and locale. This is particularly noticeable for data which crosses over daylight saving hours on data with intervals of less than 1 day. Errors are likely to be raised if they are not converted beforehand.
```
An empty `DataFrame` object can also be given to this method, which will erase all candle and volume data displayed on the chart.
___
### `update`
@ -37,7 +39,7 @@ The bar should contain values with labels of the same name as the columns requir
___
### `update_from_tick`
`series: pd.Series`
`series: pd.Series` | `cumulative_volume: bool`
Updates the chart from a tick.
@ -51,6 +53,7 @@ As before, the `time` can also be named `date`, and the `volume` can be omitted
The provided ticks do not need to be rounded to an interval (1 min, 5 min etc.), as the library handles this automatically.```````
```
If `cumulative_volume` is used, the volume data given to this method will be added onto the latest bar of volume data.
___
### `create_line`
@ -59,6 +62,11 @@ ___
Creates and returns a [Line](#line) object.
___
### `lines`
`-> List[Line]`
Returns a list of all Line objects for the chart or subchart.
___
### `marker`
`time: datetime` | `position: 'above'/'below'/'inside'` | `shape: 'arrow_up'/'arrow_down'/'circle'/'square'` | `color: str` | `text: str` | `-> str`
@ -141,7 +149,7 @@ The float values given to scale the margins must be greater than 0 and less than
___
### `crosshair`
`mode` | `vert_width: int` | `vert_color: str` | `vert_style: str` | `vert_label_background_color: str` | `horz_width: int` | `horz_color: str` | `horz_style: str` | `horz_label_background_color: str`
`mode` | `vert_visible: bool` | `vert_width: int` | `vert_color: str` | `vert_style: str` | `vert_label_background_color: str` | `horz_visible: bool` | `horz_width: int` | `horz_color: str` | `horz_style: str` | `horz_label_background_color: str`
Crosshair formatting for its vertical and horizontal axes.
@ -166,6 +174,34 @@ ___
Configures the legend of the chart.
___
### `spinner`
`visible: bool`
Shows a loading spinner on the chart, which can be used to visualise the loading of large datasets, API calls, etc.
___
### `price_line`
`label_visible: bool` | `line_visible: bool`
Configures the visibility of the last value price line and its label.
___
### `fit`
Attempts to fit all data displayed on the chart within the viewport (`fitContent()`).
___
### `hide_data`
Hides the candles on the chart.
___
### `show_data`
Shows the hidden candles on the chart.
___
### `create_subchart`
`volume_enabled: bool` | `position: 'left'/'right'/'top'/'bottom'`, `width: float` | `height: float` | `sync: bool/str` | `-> SubChart`
@ -218,7 +254,9 @@ ___
## Line
The `Line` object represents a `LineSeries` object in Lightweight Charts and can be used to create indicators. As well as the methods described below, the `Line` object also has access to the [`title`](#title), [`marker`](#marker) and [`horizontal_line`](#horizontal-line) methods.
The `Line` object represents a `LineSeries` object in Lightweight Charts and can be used to create indicators. As well as the methods described below, the `Line` object also has access to:
[`title`](#title), [`marker`](#marker), [`horizontal_line`](#horizontal-line) [`hide_data`](#hide-data), [`show_data`](#show-data) and[`price_line`](#price-line) methods.
```{important}
The `line` object should only be accessed from the [`create_line`](#create-line) method of `Chart`.
@ -241,6 +279,11 @@ Updates the data for the line.
This should be given as a Series object, with labels akin to the `line.set()` function.
___
### `delete`
Irreversibly deletes the line on the chart as well as the Line object.
___
## SubChart
The `SubChart` object allows for the use of multiple chart panels within the same `Chart` window. All of the [Common Methods](#common-methods) can be used within a `SubChart`. Its instance should be accessed using the [create_subchart](#create-subchart) method.