We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I use a default example https://lightweight-charts-python.readthedocs.io/en/latest/tutorials/events.html#live-data-topbar-events
Added only
# @barl0g: def on_horizontal_line_move(chart, line): print(f'Horizontal line moved to: {line.price}') # :@barl0g
and
chart.horizontal_line(160, func=on_horizontal_line_move) # @barl0g
Expected: horizontal line can be edited on the chart
horizontal line can NOT be edited on the chart
import asyncio import pandas as pd from lightweight_charts import Chart async def data_loop(chart): ticks = pd.read_csv('ticks.csv') for i, tick in ticks.iterrows(): if not chart.is_alive: return chart.update_from_tick(ticks.iloc[i]) await asyncio.sleep(0.03) def on_new_bar(chart): print('New bar event!') def on_timeframe_selection(chart): print(f'Selected timeframe of {chart.topbar["timeframe"].value}') # @barl0g: def on_horizontal_line_move(chart, line): print(f'Horizontal line moved to: {line.price}') # :@barl0g async def main(): chart = Chart() chart.events.new_bar += on_new_bar chart.topbar.switcher('timeframe', ('1min', '5min'), func=on_timeframe_selection) df = pd.read_csv('ohlc.csv') chart.horizontal_line(160, func=on_horizontal_line_move) # @barl0g chart.set(df) await asyncio.gather(chart.show_async(), data_loop(chart)) if __name__ == '__main__': asyncio.run(main())
- OS:GNU Linux Ubuntu 22.04.5 LTS - Library: 2.1
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Expected Behavior
I use a default example https://lightweight-charts-python.readthedocs.io/en/latest/tutorials/events.html#live-data-topbar-events
Added only
and
chart.horizontal_line(160, func=on_horizontal_line_move) # @barl0g
Expected: horizontal line can be edited on the chart
Current Behaviour
horizontal line can NOT be edited on the chart
Reproducible Example
Environment
The text was updated successfully, but these errors were encountered: