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:
@ -35,10 +35,14 @@ from lightweight_charts.js import LWC, TopBar, CALLBACK_SCRIPT
|
||||
def _widget_message(chart, string):
|
||||
messages = string.split('__')
|
||||
name, chart_id = messages[:2]
|
||||
args = messages[2:]
|
||||
arg = messages[2]
|
||||
chart.api.chart = chart._charts[chart_id]
|
||||
method = getattr(chart.api, name)
|
||||
asyncio.create_task(getattr(chart.api, name)(*args)) if iscoroutinefunction(method) else method(*args)
|
||||
if widget := chart.api.chart.topbar._widget_with_method(name):
|
||||
widget.value = arg
|
||||
asyncio.create_task(getattr(chart.api, name)()) if iscoroutinefunction(method) else method()
|
||||
else:
|
||||
asyncio.create_task(getattr(chart.api, name)(arg)) if iscoroutinefunction(method) else method(arg)
|
||||
|
||||
|
||||
class WxChart(LWC):
|
||||
|
||||
Reference in New Issue
Block a user