Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About vertical_span .. #492

Open
ZED63 opened this issue Dec 6, 2024 · 0 comments
Open

About vertical_span .. #492

ZED63 opened this issue Dec 6, 2024 · 0 comments

Comments

@ZED63
Copy link

ZED63 commented Dec 6, 2024

Question

i don't know why i'm having a hard time while trying to add a vertical span to my chart, not sure if i missed something or it's a bug (win11pro/python3.10/lightweight-charts 2.1)

here's the error i'm getting :

(py310) PS C:\Users\zed\Desktop\new_project> python .\tv.py
Exception in thread Thread-2 (loop):
Traceback (most recent call last):
File "C:\Users\zed.conda\envs\py310\lib\site-packages\lightweight_charts\chart.py", line 89, in loop
window.evaluate_js(arg)
File "C:\Users\zed.conda\envs\py310\lib\site-packages\webview\window.py", line 48, in wrapper
return function(self, *args, **kwargs)
File "C:\Users\zed.conda\envs\py310\lib\site-packages\webview\window.py", line 459, in evaluate_js
raise JavascriptException(result)
webview.errors.JavascriptException: {'name': 'ReferenceError', 'stack': 'ReferenceError: calculateTrendLine is not defined\n at eval (eval at (:4:29), :7019:29)\n at :4:29', 'message': 'calculateTrendLine is not defined'}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\zed.conda\envs\py310\lib\threading.py", line 1016, in _bootstrap_inner
self.run()
File "C:\Users\zed.conda\envs\py310\lib\threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\zed.conda\envs\py310\lib\site-packages\lightweight_charts\chart.py", line 94, in loop
raise JavascriptException(f"\n\nscript -> '{arg}',\nerror -> {msg['name']}[{msg['line']}:{msg['column']}]\n{msg['message']}")
KeyError: 'line'

Code example

import pandas as pd
from lightweight_charts import Chart


if __name__ == '__main__':
        chart = Chart(inner_width=0.5, inner_height=0.5)
        chart.set(pd.read_csv('bar_data/EURUSD_30min.csv'))
        chart.vertical_span(start_time="2024-12-04 22:00:00",end_time="2024-12-05 22:00:00")

        chart.show(block=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant