diff --git a/lightweight_charts/widgets.py b/lightweight_charts/widgets.py index c347c45..cf03019 100644 --- a/lightweight_charts/widgets.py +++ b/lightweight_charts/widgets.py @@ -60,12 +60,12 @@ def emit_callback(window, string): class WxChart(abstract.AbstractChart): def __init__(self, parent, inner_width: float = 1.0, inner_height: float = 1.0, - scale_candles_only: bool = False, toolbox: bool = False): + scale_candles_only: bool = False, toolbox: bool = False, leftScale: bool = False): if wx is None: raise ModuleNotFoundError('wx.html2 was not found, and must be installed to use WxChart.') self.webview: wx.html2.WebView = wx.html2.WebView.New(parent) super().__init__(abstract.Window(self.webview.RunScript, 'window.wx_msg.postMessage.bind(window.wx_msg)'), - inner_width, inner_height, scale_candles_only, toolbox) + inner_width, inner_height, scale_candles_only, toolbox, leftScale=leftScale) self.webview.Bind(wx.html2.EVT_WEBVIEW_LOADED, lambda e: wx.CallLater(500, self.win.on_js_load)) self.webview.Bind(wx.html2.EVT_WEBVIEW_SCRIPT_MESSAGE_RECEIVED, lambda e: emit_callback(self.win, e.GetString())) @@ -79,12 +79,12 @@ class WxChart(abstract.AbstractChart): class QtChart(abstract.AbstractChart): def __init__(self, widget=None, inner_width: float = 1.0, inner_height: float = 1.0, - scale_candles_only: bool = False, toolbox: bool = False): + scale_candles_only: bool = False, toolbox: bool = False, leftScale: bool = False): if QWebEngineView is None: raise ModuleNotFoundError('QWebEngineView was not found, and must be installed to use QtChart.') self.webview = QWebEngineView(widget) super().__init__(abstract.Window(self.webview.page().runJavaScript, 'window.pythonObject.callback'), - inner_width, inner_height, scale_candles_only, toolbox) + inner_width, inner_height, scale_candles_only, toolbox, leftScale=leftScale) self.web_channel = QWebChannel() self.bridge = Bridge(self) @@ -115,7 +115,7 @@ class QtChart(abstract.AbstractChart): class StaticLWC(abstract.AbstractChart): def __init__(self, width=None, height=None, inner_width=1, inner_height=1, - scale_candles_only: bool = False, toolbox=False, autosize=True): + scale_candles_only: bool = False, toolbox=False, autosize=True, leftScale: bool = False): with open(abstract.INDEX.replace("index.html", 'styles.css'), 'r') as f: css = f.read() @@ -132,7 +132,7 @@ class StaticLWC(abstract.AbstractChart): .replace('\n', '