subchart with streamlit
Question
Im following this https://lightweight-charts-python.readthedocs.io/en/latest/examples/subchart.html#synced-line-chart the only difference is that im using StreamlitChart. And i cant make it work. I did the exact example Is subchart not working for streamlit charts? I want to add rsi too.
When i plot the line on the base streamlit chart it works correctly .
Code example
import pandas as pd
from lightweight_charts.widgets import StreamlitChart
def create_chart(candles, rsi):
chart = StreamlitChart(inner_width=1, inner_height=0.8)
chart.time_scale(visible=False)
chart2 = chart.create_subchart(width=1, height=0.2, sync=True)
line = chart2.create_line()
chart.set(candles)
line.set(rsi)
return chart
...
chart = create_chart(candles, rsi)
chart.load()
same question in jupyter notebook
import pandas as pd
from lightweight_charts.widgets import StreamlitChart
def create_chart(candles, rsi):
chart = StreamlitChart(width=600, height=900, inner_width=1, inner_height=0.8)
chart.time_scale(visible=False)
chart2 = chart.create_subchart(width=1, height=0.2, sync=True)
line = chart2.create_line()
chart.set(candles)
line.set(rsi)
return chart
...
chart = create_chart(candles, rsi)
chart.load()
need to add chart width and height to display properly
Thank you ill test it as soon as possible.
that works, but it seems like hotkeys won't work in streamlit ? is there any solutions?
Does not work in jupyter